Stallman 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.
If 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:)
I 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."
Beautiful. 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.
There'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.
A 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.
I 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.
There are a few worthy webextensions that can do the basics of what youtube-do does. Enough to only need the command line for batch stuff or more advanced conversions.
What kind of diagnoses are you interested in learning about? This may be too rudimentary, but I found ‘The Linux Command Line’ a good book to build up skills and knowledge.
Also I would say: don’t try to force it. People write a lot about ricing their Gentoo installs, which tiling window managers use the least RAM and which plugins they use with Neovim. This makes using the terminal effectively seem like a big thing.
But the terminal is exactly not that — all proxies are removed and you just use it for what you want to do, nothing more. Just start by using grep on a text file instead of opening that text file up in your editor.
You can bind dict to the "keywordprg" query key ('K') in vim.
By default, that's tied to 'man', which lets you look up a particular command in the system manpages. Swap that to dict for text files (say, filetype markdown or HTML), and you've now got a dictionary lookup for any given word. Not sure of spelling or meaning? Position cursor on word and hit 'K', and you'll get the word's definition, or a match of near-spellings.
The dict database can also be extended to other datasets -- anything with a keyword-result relationship. On Debian, this includes the US Census "Tiger" files (thanks to Bruce Perens for buying a copy and sharing them to the project), which lets you look up any specific city or place name in the United States.
You can specify the dictionary you want to use on the commandline, or write a shell alias or function to query a specific database, say:
Or you can write your own. I've got a wrapper around the NOAA's weather six-day forecast page which dumps a text-formatted version of just the forecast text (a lot of ugly sed and awk). Having to write programmes to remove the text other programmes lard onto a simple data request is Where We Are Now in Today's WWW.
Or a lookup for the Online Etymological Dictionary:
Usually when the internet says "Run these commands", they either don't tell you what they do, or tell you to just check `man`. The problem is that man pages can be super long, can have a somewhat intimidating syntax, and 1,000 flags that arent your flag. Running `tldr program_name` gives you a way simpler manual with common flags and actual examples.
> I rarely have the faintest idea of what it is that I'm typing in.
I suggest checking out Like Smith's beautifully assembled video guides, whom I think has done a lot for newbies by releasing comprehensible content while minimising the whole RTFM attitude that kept newbies away from the terminal.
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/) which strips off everything but the prices themselves (see sample output: https://pastebin.com/gR2j3zB3)
However that's not something which will query for a specified portfolio.
% 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
Launch 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.
you 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.
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)
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) 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).
With 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.
What 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.
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!)
There are other apps with integrated sixel support like mikkuter for twitter, gnuplot (there was 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 )
The 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 - 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.
I'm not really convinced by the general mindset of ths discussion. What programs need is not to display a "png file" inside the terminal. What you want is to access the individual pixels of a rectangular framebufer using serialized escape sequences. That way you can intetact with the images.
That 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.
If 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.
'Couple' is a word that in some contexts means two specifically, but in other (informal) contexts means a small number. Generally when somebody describes three or four things as a "couple", they're being informal and a correction isn't warranted.
It's more like saying "I love my dependence on images, else I would still be stuck using text". Well, text can be more information-dense and efficient than an image or a movie. And similarly, a CLI can be more efficient than a GUI. Depends on the application.
And if the "MS DOS" reference is about release time, well, there are CLI tools that were built far more recently, and are much more modern than many GUI tools people use.
This 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)
> 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?
It 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).
`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.
How about finding out what files are there in the first place, what data the files represent and which programs would be useful to operate on the files?
In other words, things a typical GUI file manager can do easily.
I just meant that IMO it's more productive to get familiar with the shell and demonstrate powerful shell alternatives than learning a handful of situation-specific CLI alternatives. Getting to know things like shell expansions, using ipython (or whatever) for adhoc data crunching, the "jq" command, sup/mutt/whatever and so on will make someone a much better CLI wrangler (and less dependent on GUI tools) than knowing you can Google from the command line.
I 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.
I'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.
I 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.
It'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
78 comments
[ 1.3 ms ] story [ 106 ms ] threadMore 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.
"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.
When I need something, I use pacman.
Line endings can become an issue, as can the various BOM characters.
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.
https://github.com/jdxcode/tmux-weather
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
Also I would say: don’t try to force it. People write a lot about ricing their Gentoo installs, which tiling window managers use the least RAM and which plugins they use with Neovim. This makes using the terminal effectively seem like a big thing.
But the terminal is exactly not that — all proxies are removed and you just use it for what you want to do, nothing more. Just start by using grep on a text file instead of opening that text file up in your editor.
By default, that's tied to 'man', which lets you look up a particular command in the system manpages. Swap that to dict for text files (say, filetype markdown or HTML), and you've now got a dictionary lookup for any given word. Not sure of spelling or meaning? Position cursor on word and hit 'K', and you'll get the word's definition, or a match of near-spellings.
The dict database can also be extended to other datasets -- anything with a keyword-result relationship. On Debian, this includes the US Census "Tiger" files (thanks to Bruce Perens for buying a copy and sharing them to the project), which lets you look up any specific city or place name in the United States.
You can specify the dictionary you want to use on the commandline, or write a shell alias or function to query a specific database, say:
Which allows you to query ZIP Codes or place names without otherwise mentioning the dictionary on the commandline.There are numerous other query tools bundled together in tools such as surfraw(1) (https://packages.debian.org/buster/surfraw), with 123 separate query targets.
Or you can write your own. I've got a wrapper around the NOAA's weather six-day forecast page which dumps a text-formatted version of just the forecast text (a lot of ugly sed and awk). Having to write programmes to remove the text other programmes lard onto a simple data request is Where We Are Now in Today's WWW.
Or a lookup for the Online Etymological Dictionary:
(w3m is escaped '\' to byapass the alias I've defined, 'alias w3m="w3m -B"', which defaults to opening my bookmarks file if no argument is given.)Learning what you're typing, and what it does, and what the underlying logic are, is much of the fun.
Usually when the internet says "Run these commands", they either don't tell you what they do, or tell you to just check `man`. The problem is that man pages can be super long, can have a somewhat intimidating syntax, and 1,000 flags that arent your flag. Running `tldr program_name` gives you a way simpler manual with common flags and actual examples.
[1]https://github.com/tldr-pages/tldr
I suggest checking out Like Smith's beautifully assembled video guides, whom I think has done a lot for newbies by releasing comprehensible content while minimising the whole RTFM attitude that kept newbies away from the terminal.
But yes, also RTFM.
Depends on your job. For certain jobs is 10x more useful than most programs you use every day...
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/) which strips off everything but the prices themselves (see sample output: https://pastebin.com/gR2j3zB3)
However that's not something which will query for a specified portfolio.
It does feed xrootconsole nicely though.
https://github.com/jorgebastida/awslogs
Which allows you to stream Cloudwatch logs via a command like:
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) 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
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 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-vi...
There are other apps with integrated sixel support like mikkuter for twitter, gnuplot (there was 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 )
Many important people are there, e.g. the Tmux maintainer/developer Nicholas Marriott, the Mintty developer, some Xterm.js developer, and others.
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 - 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.
Isn't there a word for that ? I'm thinking of "several". That is what I learned in school (not a native english speaker )
It's more like saying "I love my dependence on images, else I would still be stuck using text". Well, text can be more information-dense and efficient than an image or a movie. And similarly, a CLI can be more efficient than a GUI. Depends on the application.
And if the "MS DOS" reference is about release time, well, there are CLI tools that were built far more recently, and are much more modern than many GUI tools people use.
https://github.com/draperunner/cutters
Which enables you to run:
to get queue times in Oslo. Made by a colleague of mine.curl -s 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}'
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)
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?
"Awful" was a mean description of this article. I'll fix it (edit: comment, not fix).
(Ok, it’s a bit cheating, sort of text/GUI, but makes file manipulation so easy on console)
In other words, things a typical GUI file manager can do easily.
ls?
> what data the files represent
ls, file
> which programs would be useful to operate on the files?
I guess I assume that people know this kind of thing, but xdg-open is fine.
I just meant that IMO it's more productive to get familiar with the shell and demonstrate powerful shell alternatives than learning a handful of situation-specific CLI alternatives. Getting to know things like shell expansions, using ipython (or whatever) for adhoc data crunching, the "jq" command, sup/mutt/whatever and so on will make someone a much better CLI wrangler (and less dependent on GUI tools) than knowing you can Google from the command line.
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.
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.
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
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.