The Command Line

Coming from the Graphical User Interface (GUI) land of Mac and Windows, the command line can appear very intimidating (in fact, if you are from Windows (like I was), this is rightfully so - the command line there is ugly and weak... what do you even do with it in Windows??). It may seem like the domain of ``hackers", something ``old", something that is ``hard to use" and most critically (and wrong), something ``useless to the non-specialist". This is not to wage war on the idea of GUIs (they have their place and use cases), but to push back against the sprawl of GUIs where they do not need to be. Like having a kitchen cupboard full of as-seen-on-TV kitchen gadgets, when you could probably have just used a knife in place of most of the whole cupboard. Chef knives may be called ``Chef knives", but they are accessible (and highly useful) to anyone, not just Chefs.

Why Is the Command Line... Better?

Have you ever played a video game and tried to hold a conversation with an NPC? You don't really get much choices, do you? There is something a bit unnatural about it. This is because they take something fairly abstract (communication), and put it into a pre-packaged program - the game. For the purposes of gameplay, the dialogue is servicable, but definitely doesn't help with ``immersion". Language and communication is full of contingent sequences, chains of events, inflections, etc., that are difficult to capture with video-game dialogue.

Or even more related, in a video-game, ever notice how limiting they are? There's a bush in the way, and you can't jump over it. There are ``boundaries" you can't cross on the map, there are things you can't say. You have a hammer, wood, and screwdriver, why can't you build a house as you please???

This is because (A) simulating the mechanics of such a world such that the manifold utility of tools can be realized is extremely difficult in the reified virtual world of a video game, and (B) emulating the mechanics of the world by considering every possible outcome is extremely unreasonable, will make game updates painfully hard, and probably the game will be very buggy.

Likewise, lots of computer functionality has lots and lots of options, piping standard input and output from one program into another, customizing the particular functionalities it executes and the format it takes, and so on. Tools (especially in the GNU/Linux world) have manifold possibilities. And taking all of that and trying to capture the ``essential" parts inside of a GUI will (like video game dialogue) necessarily cut out a lot of the flexibility and power, although still providing a servicable substitute. Does it make a bit more sense why the command line is much much nicer to use (once you get the hang of it... which isn't that steep of a learning curve)?

...

Here are some uses that don't even get into the utility of the command line for my work - that is, this stuff does not require any coding knowledge (just the essentials of bash, and reading the man pages or other guides for the programs).

Vim - Everything is a text file!

Of course, the first thing I talk about is Vim. Vim is a text editor that emphasizes the editing part, which is one of the most time consuming and laborious processes... when not using Vim. Basically typing becomes very nice with Vim. I typically write documents in a Tex file, and notes and stuff in files without any extensions (ie 'note.tex' vs 'note'), or with made up extensions for easier organization. If someone needs to edit the file that isn't familiar with these syntaxes, they are easy enough to convert to a docx file (ie with pandoc), or if it doesn't use special syntax (ie my notes files), I can just make the `note` file into `note.txt' with the command `mv note note.txt`.

Shell ultra basics - Computer navigation

It's just easy to navigate the computer from the command line. I used to use Ranger (and still occasionally pull it out), but more and more, I find simply navigating my directories via the command line (and heavy use of tab completion) is extremely easy and powerful.

Newsboat - Not Just News

I use the RSS feeder ``Newsboat", which aggregates blog posts (from tech to my hobbies), news posts from multiple sources, twitter feeds, youtube feeds, podcasts, science literature, and so on, all in one place. I can navigate this via the command line, using Vim-like shortcuts! This makes news much much more accessible to me. It can even load Youtube videos from the command line, using...

When Newsboat doesn't work... NewsFlash?

I've been having issues with Newsboat and PNAS's feedburner feed links. I'm trying them out in the GUI-based application NewsFlash that uses some vim-bindings (so not command-line based). I still suggest Newsboat, it's just very, very nice. This is just one annoying issue, and hopefully fixable.

mpv - Music (and Media in general)

The command-line program ``mpv" is highly useful. It can run playlists, and so is great for listening to albums locally. As a command-line utility, you can open up multiple instances simultaneously as well, which can be useful if you are trying to get a certain combo of sounds (maybe relaxing music plus rain sounds). ``Couldn't you do the same on Youtube?" Yes, of course you can, but then you're using up that precious bandwidth, and are dependent on loading speeds and internet accessibility. PLUS, the big thing is, you can run it all from the command line.

You can also watch movies with mpv, which I do! It's great. This can also be used when watching youtube videos from Newsboat.

Zathura - Reading (pdf, epub, cbz, etc.)

In my Windows days, reading pdfs was a pain. Moving to the Linux world, my first experience with a vim-like pdf reader was ``Evince" (I still use this to annotate pdfs, things like that - Evince is not a bad program to be clear!). Then I found Zathura, which has a lot more flexibility, and I enjoy the vim-like keys much better.

Why make a fuss about these? Because reading pdfs is now no longer a pain. It's really easy, I'd say sometimes about 90 percent as nice as reading on paper, and in some cases, it's nicer (and that's not even to get into organization being much easier on the command line than with stacks of papers).

Zathura has many nice functions related to vim-bindings. Also, if you're in a pdf at least (doesn't seem to work with epub files), if you press tab, it gives you a VERY slick table of contents to navigate with.

(When Zathura doesn't work... Evince)

One big issue with Zathura is copying from it (ie copy-and-paste) is very difficult and annoying. Often this isn't an issue, but when it is... ughh. For example, if there is a link in a pdf. Re-typing a URL isn't terrible, but slightly annoying. Another thing is you can't edit files, like highlight or write notes. When I need to do that, I use the program Evince. It has weaker vim bindings (ie gg, G, J, K don't do anything - maybe that's editable?), but if you press "tab", you can enter the page number you want to go to, so it is servicable.

Pass - Password Management

I use the `pass` GNU program to manage my passwords, and combined with `dmenu` (see 'Window Managers' below), it's quite a convenient little system. Basically you have all of your passwords stored in a list, and to access this list, you have to know the list's password. This keeps your passwords off the web (and so a bit safer), and this can be backed up elsewhere if you're worried about theft or a crashed storage or whatever. It doesn't require some annoying GUI either (although `keepass` seems like overall good software to me, using `pass` is much more straightforward to me). Just don't lose the main password!

Mutt - Email

I haven't actually started using email on the command line, but plan to soon.

Smaller Stuff

One big (but smallish) thing is unzipping - unzipping files on Windows (iirc) requires using a program that says your free trial is about to expire, forever. It's kind of weird and wonky. In the command line, you just write `unzip filename.zip` and it unzips it for you. Same with other compression formats. It's stupid easy!

Another thing I've recently started playing with is sc-im, a command-line vim-based spreadsheet editor (ie, a less annoying application than Excel).

Likewise, putting up a firewall is easy, using a vpn is easy (if it has a command line interface (CLI) option), so many nice things. You can even mine crypto from the command line, if that's your thing!

Scripting/Customizing - A Bit More Technical!

What's wonderful about this whole command line environment is you can see much much more clearly how ``coding" is actually useful to your life. You can do all of the above with practically no coding knowledge, however, you'll find that if you write a little bash script here and there, suddenly your life is a little easier. Or maybe you'll go and edit an rc file, or update your PATH variable. You'll get a better feeling of what is going on under the hood, and you'll understand how it impacts everything... since you're much more ``in tune" with the command line!

Window Managers - A Bit More Technical

As you feel more comfortable with the modularity of a GNU/Linux system, you may feel compelled to use a window manager, which more efficiently uses your screen space, making windows easy to manipulate, move, close, open, etc. Combine this with `dmenu`, and life is a breeze.

return to home page