9 ms·
Command Line Tools to Break Your Dependence on the GUI
- lewisj489 7y agoThis is really cool. Has anyone made a version for Windows?
- incomplete 7y agoyep, it's called linux! :)
- mwexler 7y agoGroan. But I still smiled.
- BuildTheRobots 7y agoStallman would point out that it's gnu/linux... but then there's a number of things he'd likely try and point out. More seriously, this doesn't seem to be linux as much as it is bash and a handful of commonly found on linux tools - all of which you can now run on windows anyway. Windows users: install bash and follow along.
- yjftsjthsd-h 7y agoIf one were feeling contrary, one could point out that it's not GNU/Linux in this context... it's GNU/NT (WSL1 and cygwin). Unless we're talking about WSL2, in which case it is GNU/Linux again:)
- BuildTheRobots 7y agoI saw Stallman talk about a decade ago and was thrilled to be picked on, so asked a question about my Linux setup. "I think you'll find," he interrupts me, like he's done to most of the other people asking questions "that it's actually GNU/Linux" and then fixes me with a look usually reserved for telling an adult that yes, they really have just soiled themselves. "Actually," I took great joy in responding, "I'm running Mr Torvalds' kernel with a BSD userland, so really, I'm pretty sure I'll find it's not." We haven't stayed in touch since.
- yjftsjthsd-h 7y agoBeautiful. I've been wanting to do that, actually, but I keep having a rough time because the BSDs tend to assume you're using their kernel, libraries, and userspace all together.
- deleted 7y ago[deleted]
- csdvrx 7y agoYes, mintty + msys2. I use gnuplot, w3m, tmux, vim, gcc etc. on Windows 10 which is my main OS. When I need something, I use pacman.
- pjc50 7y agoThere's plenty of options; WSL2 which feels more like a virtualised system but with access to your files (careful!), or the msys system shipped with git-bash, or the more traditional Cygwin. Line endings can become an issue, as can the various BOM characters.
- exergy 7y agoA dictionary? I mean, that's neat and all, but not all that useful is it? I might check the weather once a day, tops. This is better solved by having a widget on my smartphone. Same for the dictionary, and same for short google searches too (Firefox Focus). I had a twinge of hope that this might have been more of an introduction to using the terminal effectively on Linux for diagnoses. I'm new to Linux, and every time I have an issue and find a thread addressing it, they ask for me to run a whole bunch of commands and paste a bunch of logs. I'm happy to do that, don't get me wrong, but I rarely have the faintest idea of what it is that I'm typing in.
- dickeytk 7y agoI would never think to check the weather, but having it in my tmux status is useful https://github.com/jdxcode/tmux-weather https://github.com/jdxcode/tmux-weather
- enriquto 7y agowhy would you want to know the weather at the spacetime position you are? A forecast, ok, but why here and now? Don't you have windows where you work?
- dickeytk 7y agoI don’t know how warm it is outside. Chiefly I use it to tell if it’s a good time for a run or if I need to put a jacket on before stepping outside.
- danso 7y agoI interpreted the premise of the article as weaning people off of GUI with everyday trivial tasks that can be done via CLI. I myself do almost all my work from the CLI, but it was this blog post [0], specifically the open, pbpaste, and screenshot commands, that got me into dabbling with my shell, before I understood the power and convenience of shell scripting. I try to get novices interested in the shell via youtube-dl, which is very useful and has no good GUI counterpart. However, for a lot of people, downloading copies of video are just not an everyday task like checking the weather or dictionary. [0] https://news.ycombinator.com/item?id=10143143 https://news.ycombinator.com/item?id=10143143
- whyhow 7y agoDoes anyone know of a similar tool to the weather api wttr.in for stock prices?
- dredmorbius 7y agoThere's surfraw(1)'s "--stockquote" argument. I've looked around for a freely-available source of raw stock quote data without success (though not invested too much time in it). I've written my own wrapper around Yahoo's stock quotes page (https://finance.yahoo.com/ https://finance.yahoo.com/) which strips off everything but the prices themselves (see sample output: https://pastebin.com/gR2j3zB3 https://pastebin.com/gR2j3zB3) However that's not something which will query for a specified portfolio. It does feed xrootconsole nicely though.
- tomcooks 7y agoRate.sx for crypto
- ancarda 7y agoIf you use Haskell, then I'd recommend just using ghci over bc because you can't do floating point stuff in bc: 1/3 0 Whereas ghci, or your language's REPL, will likely do better: > 1/3 0.3333333333333333
- clappski 7y agoThat's because bc is fixed precision: % bc bc 1.07.1 Copyright 1991-1994, 1997, 1998, 2000, 2004, 2006, 2008, 2012-2017 Free Software Foundation, Inc. This is free software with ABSOLUTELY NO WARRANTY. For details type `warranty'. scale=10 1/3 .3333333333
- encode 7y agoLaunch bc using the -l or --mathlib option to get 20 decimals of precision and load some basic math functions. I have this as an alias in my .bashrc, so I don't need to do this every time I launch the program.
- enriquto 7y agoyou can use pari-gp for your floating point needs inside unix. It's an extremely beautiful calculator language (for rational, floating point and polynomials). Also octave and julia, if you are mostly interested in matrices, but they take quite a few miliseconds to start and are not as useful inside shell loops.
- RBerenguel 7y agoYou can set up bc to any scale by adding scale=INTEGER for some reasonable INTEGER, say, 6, to your ~/.bc file (you need to also export BC_ENV_ARGS=~/.bc), or alias bc to bc -l). After having gp-pari fail after a brew upgrade I started using bc instead and have been relatively happy so far (although I miss isprime and factors which I used sparingly)
- faho 7y agoDo note that setting scale breaks modulo tho.
- msluyter 7y agoI love finding good command line replacements for UIs. One I've grown to rely on a lot these days is awslogs: https://github.com/jorgebastida/awslogs https://github.com/jorgebastida/awslogs Which allows you to stream Cloudwatch logs via a command like: awslogs get <log group name> ALL --watch which is cool because you can just specify the log group and get all streams without having to dig around for the specific stream in the AWS console. There's a python based command line HN client (https://github.com/donnemartin/haxor-news https://github.com/donnemartin/haxor-news) that's nice, although I think the dependencies need updating (I get various conflicts if I try to install other packages in the same venv). For twitter, rainbowstream is nice: https://github.com/orakaro/rainbowstream https://github.com/orakaro/rainbowstream
- rdrey 7y agoI can recommend `pipx` (pipx — Install and Run Python Applications in Isolated Environments) https://pipxproject.github.io/pipx/ https://pipxproject.github.io/pipx/
- bil7 7y agoawful scroll-jacking on this site. I really hate that.
- pwg 7y agoWith the javascript blocked (by NoScript in default deny all JS mode) there is no scroll-jacking, and scrolling works just as expected using the browser scrollbar.
- cranekam 7y agoWhat is even the point of scroll-jacking like this? Is there some SEO or monetization opportunity I don't get? Pretty much everyone (surely including the site owner?) who runs into weird chunky wrestling-an-oiled-pig scrolling like this is going to find it a crappy experience so there must be some compelling reason that I don't understand for its continuing existence.
- csdvrx 7y agoWork in progress, but sixel support may be coming to mainline tmux: git clone git://github.com/tmux/tmux git switch sixel git checkout b1904c9b8db514133d3372aac13b2ff0b2093cc3 This will give you the "placeholder" box for sixels in terminals that do not support sixel (but you should use mlterm on Linux or mintty on Windows) The upcoming feature is to replace this placeholder box by unicode art for the sixels, cf https://github.com/tmux/tmux/issues/1613 https://github.com/tmux/tmux/issues/1613 for the current discussion. Then you will be able to break your dependency on the GUI just by using w3m and your favorites sites, whether your terminal supports sixel or not (but it should, it's just better!) apt-get install libsixel1-bin w3m -sixel -o display_image=1 google.com Cf https://apple.stackexchange.com/questions/244930/how-do-i-view-inline-images-in-w3m/363376 https://apple.stackexchange.com/questions/244930/how-do-i-vi... There are other apps with integrated sixel support like mikkuter for twitter, gnuplot (there was https://github.com/csdvrx/sixel-gnuplot https://github.com/csdvrx/sixel-gnuplot , but now the sixel backend is compiled by default in the official gnuplot-nox starting from debian-10) At the moment, I'm working on a mutt hack rendering outlook emails with all their included thingies (images etc) into sixels. If someone is looking for an idea, it'd be great to have a IRC client that replaces URL containing pictures by their sixels renditions, a bit like what lsix does ( https://github.com/hackerb9/lsix https://github.com/hackerb9/lsix )
- albertzeyer 7y agoYes. This (image support in general in Terminal emulators and Terminal multiplexers) is currently being actively discussed here: https://gitlab.freedesktop.org/terminal-wg/specifications/issues/12 https://gitlab.freedesktop.org/terminal-wg/specifications/is... Many important people are there, e.g. the Tmux maintainer/developer Nicholas Marriott, the Mintty developer, some Xterm.js developer, and others.
- csdvrx 7y agoThe discussions are very interesting, but I'm not sure they are going anywhere. Sixels might win by default. It's not a bad thing. Sixels in 16m colors are quite versatile. But let's suppose that, eventually, a better standard for terminal image support might emerge. Anything that can already support sixels won't be too hard to change to support this new standard, unless it doesn't use pixels -- though it would be neat if this standard was vector based, like ReGIS: https://en.wikipedia.org/wiki/ReGIS https://en.wikipedia.org/wiki/ReGIS - I want SVG in my terminal :-) For now, sixels already work reliably for most of the things I do. So now, I concentrate on the applications, to make sure most of my workflow can be console based.
- pjmlp 7y agoI love my dependence on the GUI, otherwise would still be stuck using MS-DOS.
- scroot 7y ago"Slide rules to replace your dependence on calculators"
- ska 7y agoThat analogy doesn't hold well though, because calculators were (at least eventually) better at everything a slide rule could do. This article is predicated on the idea that this doesn't hold for CLI->GUI. You may disagree, but it's not obviously false.
- scroot 7y agoYes, I caught the drift of the article. I think a better title might have been "Teletype Emulation Strategies to Break Your Dependence on the GUI"
- Pete_D 7y agoIf MS-DOS had enjoyed as much developer attention as the *nix command line experience has over the past couple of decades, that might not be so bad a prospect.
- icefog 7y agoI like awk as a calculator: calc () { awk "BEGIN { print "$*" }" } $ calc "2^16" 65536 $ calc "2*16" 32 $ calc "2+16" 18
- udfalkso 7y agopython irb etc.
- Pete_D 7y agounits, too: $ units -t "sqrt(3^2 + 4^2)" 5 $ units -t "forty rods per hogshead" "miles per usgallon" 0.0019825576 $ units -t "32GB / (1MB/s)" "hours; minutes" 8;53.333333
- gowld 7y agohttps://en.wikipedia.org/wiki/Bc_(programming_language)#Using_bc_in_shell_scripts https://en.wikipedia.org/wiki/Bc_(programming_language)#Usin... $ bc -l <<< 2^16 65536 $ bc -l <<< 2*16 32 $ bc -l <<< 2+16 18
- henrikwm 7y agoYou can use this CLI to plan you haircut by browsing queue times for Cutters hair salons: https://github.com/draperunner/cutters https://github.com/draperunner/cutters Which enables you to run: $ npx cutters | grep Oslo | head -3 to get queue times in Oslo. Made by a colleague of mine.
- fowlie 7y agoNice. I have this as an alias in my ~/.zshrc: curl -s https://www.cutters.no/api/salons https://www.cutters.no/api/salons | jq '.data[] | select(.location.key == "oslo") | .details.estimatedWait /= 60000 | {name: .name, wait: .details.estimatedWait, serving: .details.numberOfServing, waiting: .details.numberOfWaiting}'
- cranekam 7y agoThis article is awful. You're not going to "break your dependence on the GUI" by replacing 5 things you do a few times a day with obscure, less good CLI alternatives. What about things like manipulating files and running programs? Aren't they the things people do with computers? Also, bc is especially terrible. Nobody who is already "dependent on the GUI" is going to want to know about scale= and all that. Better to use Python or even bash (echo $((123+456)) etc)
- yjftsjthsd-h 7y ago> What about things like manipulating files and running programs? Aren't they the things people do with computers? I'm confused. Manipulating files and running programs is a given, isn't it? You mean ls/cp/mv/rm-style? And running programs is... type in the name of the program (if in $PATH) or its path (if not) and press enter. Why would anyone bother blogging about that?
- cranekam 7y agoIt depends on what people use the GUI for. It's not inconceivable that people start up gvim to make a new file (instead of cat > file) or use some bulk-renaming tool instead of learning about shell expansions. "Awful" was a mean description of this article. I'll fix it (edit: comment, not fix).
- wruza 7y agotouch file if you need an empty file (also prevents accidental truncation).
- yjftsjthsd-h 7y ago`vim newfile` (or gvim/nano/emacs/whatever) will create a new file. I won't say I've never created a file with cat (handy for pasting), but it's a little unusual.
- cranekam 7y ago
- excalibur 7y agoI never tried googler, but I have used lynx before. Far from a productivity boost, all it really did was help me look busy to the untrained eye while reading HN.
- dwrodri 7y agoI'm a little late to the party, but something I've come realize recently is that my affection towards CLI applications comes from the fact that I usually don't have to take my hands off the keyboard. Human hands can move very fast, faster than we can assemble cogent thoughts thanks to muscle memory (and other things that I'm sure I'm not aware of). I don't know if this is a universal thing, but I like it when I don't have to think about how to get something done. I consciously picture the end goal in my mind, and my hands just do. Of course, I'm a sloppy typist, and still relatively unrehearsed when it comes to working with Vim and friends. But I've been most of the standard GNU applications long enough to realize that my brain no longer directs my hands to interact with the keyboard for frequent simple tasks (generate a line plot for this two column CSV, use awk to get the penultimate column of this file, hash files in a directory to remove duplicates, open HN in a browser...). I'm also a big sucker for working with programs that compose well with other programs. If I had all the time and money in the world, I'd love to have more GUI apps that explored GUI/CLI interop better. I think one example many developers can comment on is how nice it is when you can combine CLI git commands with git in your code editor. Sometimes, it's just easier to resolve ugly merge conflicts with a GUI. Or there's a really weird command that doesn't exist in your GUI so you need to type it out on the commandline. There's definitely a lot more work to be done in this domain and I'm excited to see how software/OS/library developers explore this in years to come.
- curioussavage 7y agoI came to a similar realization which prompted me to start working on a suite of GUI programs that are keyboard focused. I think that is very different than an app with good keyboard shortcuts btw which is why, for example, despite many editors having great keyboard shortcuts I keep going back to vim. So I’m Making basic apps that are intended to be used entirely with a keyboard and just happen to support mouse input too. I realize this doesn’t work well for everything but my todo app and my note taking app should work great at least.
- bondedScrotes 7y agoIt's funny how condescending some will try to be about use of the command line, as if it's something special. You can quickly invert this to read as: GUI configurations to break your dependence on the command line. In moment's thought, it becomes very obvious that a GUI can readily conceal complexity and require earned skill in the same way any text mode interface might. Text command skills also evaporate just as quickly when you realize you were just locked into preferences specific to the system they bind to. The command line is not better than other ways of completing tasks. When Linux (and each and every last variant) dies (however long that may take), it will become all too obvious that the essential commands people memorized were only useful within the scope of that particular operating system
- xg15 7y agoLots of people in this thread are recommending blogs, videos or books to get to know the command line or just tell to RTFM. I'd like to note that no manual at all is needed to understand a basic menu structure or a GUI system with consistently used widgets.