summaryrefslogtreecommitdiff
path: root/cmd/ref/life on the command line.txt
blob: 005ee199932c27890ed6ac1ce197e9b1a3364ca0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
---
title: Life on the Command Line
date: 2014-12-30T18:58:10Z
source: http://stephenramsay.us/2011/04/09/life-on-the-command-line/
tags: #cmdline

---

A few weeks ago, I realized that I no longer use graphical applications.

That's right. I don't do anything with gui apps anymore, except surf the Web. And what's interesting about that, is that I rarely use cloudy, ajaxy replacements for desktop applications. Just about everything I do, I do exclusively on the command line. And I do what everyone else does: manage email, write things, listen to music, manage my todo list, keep track of my schedule, and chat with people. I also do a few things that most people don't do: including write software, analyze data, and keep track of students and their grades. But whatever the case, I do all of it on the lowly command line. I literally go for months without opening a single graphical desktop application. In fact, I don't — strictly speaking — have a desktop on my computer.

I think this is a wonderful way to work. I won't say that _everything_ can be done on the command line, but most things can, and in general, I find the cli to be faster, easier to understand, easier to integrate, more scalable, more portable, more sustainable, more consistent, and many, many times more flexible than even the most well-thought-out graphical apps.

I realize that's a bold series of claims. I also realize that such matters are always open to the charge that it's "just me" and the way I work, think, and view the world. That might be true, but I've seldom heard a usability expert end a discourse on human factors by acknowledging that graphical systems are only really the "best" solution for a certain group of people or a particular set of tasks. Most take the graphical desktop as ground truth — it's just the way we do things.

I also don't do this out of some perverse hipster desire for retro-computing. I have work to do. If my system didn't work, I'd abandon it tomorrow. In a way, the cli reminds me of a bike courier's bicycle. Some might think there's something "hardcore" and cool about a bike that has one gear, no logos, and looks like it flew with the Luftwaffe, but the bike is not that way for style. It's that way because the bells and whistles (i.e. "features") that make a bike attractive in the store get in the way when you have to use it for work. I find it interesting that after bike couriers started paring down their rides years ago, we soon after witnessed a revival of the fixed-gear, fat-tire, coaster-break bike for adults. It's tempting to say that that was a good thing because "people didn't need" bikes inspired by lightweight racing bikes for what they wanted to do. But I think you could go further and say that lightweight racing bikes were getting in the way. Ironically, they were slowing people down.

I've spent plenty of time with graphical systems. I'm just barely old enough to remember computers without graphical desktops, and like most people, I spent years taking it for granted that for a computer to be usable, it had to have windows, and icons, and wallpapers, and toolbars, and dancing paper clips, and whatever else. Over the course of the last ten years, all of that has fallen away. Now, when I try to go back, I feel as if I'm swimming through a syrupy sea of eye candy in which all the fish speak in incommensurable metaphors.

I should say right away that I am talking about Linux/Unix. I don't know that I could have made the change successfully on a different platform. It's undoubtedly the case that what makes the cli work is very much about the way Unix works. So perhaps this is a plea not for the cli so much as for the cli as it has been imagined by Unix and its descendants. So be it.

I'd like this to be the first of a series of short essays about my system. Essentially, I'd like to run through the things I (and most people) do, and show what it's like to run your life on the command line.

First up . . .

**Email**

I think most email programs really suck. And that's a problem, because most people spend insane amounts of time in their email programs. Why, for starters, do they:

_Take so long to load_

Unless you keep the app open all the time (I'm assuming you do that because you have the focus of a guided missile), this is a program that you open and close several times a day. So why, oh why, does it take so much time to load?

What? It's only a few seconds? Brothers and sisters, this is a _computer._ It should open _instantaneously._ You should be able to flit in and out of it with no delay at all. Boom, it's here. Boom, it's gone. Not, "Switch to the workplace that has the Web browser running, open a new tab, go to gmail, and watch a company with more programming power than any other organization on planet earth give you a…progress bar." And we won't even discuss Apple Mail, Outlook, or (people . . .) Lotus Notes.

_Integrate so poorly with the rest of the system?_

We want to organize our email messages, and most apps do a passable job of that with folders and whatnot. But they suck when it comes to organizing the content of email messages within the larger organizational scheme of your system.

Some email messages contain things that other people want you to do. Some email messages have pictures that someone sent you from their vacation. Some email messages contain relevant information for performing some task. Some email messages have documents that need to be placed in particular project folders. Some messages are read-it-later.

Nearly every email app tries to help you with this, but they do so in an extremely inconsistent and inflexible manner. Gmail gives you "Tasks," but it's a threadbare parody of the kind of todo lists most people actually need. Apple mail tries to integrate things with their Calendar app, but now you're tied to that calendar. So people sign up for Evernote, or Remember the Milk, or they buy OmniFocus (maybe all three). Or they go add a bump to the forum for company X in the hope that they'll write whatever glue is necessary to connect _x_ email program with _y_ task list manager.

I think that you should be able to use _any_ app with _any_ other app in the context of _any_ organizational system. Go to any LifeHacker-style board and you'll see the same conversation over and over: "I tried OmniOrgMe, but it just seemed too complicated. I love EternalTask, but it isn't integrated with FragMail . . ." The idea that the "cloud" solves this is probably one of the bigger cons in modern computing.

Problem 1 is immediately solved when you switch to a console-based email program. Pick any one of them. Type pine or mutt (for example), and your mail is before your eyes in the time it takes a graphical user to move their mouse to the envelope icon. Type q, and it's gone.

Such programs tend to integrate well with the general command-line ecosystem, but I will admit that I didn't have problem 2 completely cracked until I switched to an email program that is now over twenty years old: [nmh][1].

I've [written elsewhere][2] about nmh, so allow me to excerpt (a slightly modified) version of that:

> The "n" in nmh stands for "new," but there's really nothing new about the program at all. In fact, it was originally developed at the rand Corporation decades ago.

> We're talking old school. Type "inc" and it sends a numbered list of email subject lines to the screen, and returns you to the prompt. Type "show" and it will display the first message (in _any_ editor you like). You could then refile the message (with "refile") to another mailbox, or archive it, or forward it, and so on. There are thirty-nine separate commands in the nmh toolset, with names like "scan," "show," "mark," "sort," and "repl." On a day-to-day basis, you use maybe three or four.
>
> I've been using it for over a year. It is — hands down — the best email program I have ever used.
>
> Why? Because the dead simple things you need to do with mail are dead simple. Because there is no mail client in the world that is as fast. Because it never takes over your life (every time you do something, you're immediately back at the command prompt ready to do something else). Because everything — from the mailboxes to the mail itself — is just an ordinary plain text file ready to be munged. But most of all, because you can combine the nmh commands with ordinary unix commands to create things that would be difficult if not impossible to do with the gui clients.
>
> I now have a dozen little scripts that do nifty things with mail. I have scripts that archive old mail based on highly idiosyncratic aspects of my email usage. I have scripts that perform dynamic search queries based on analysis of past subject lines. I have scripts that mail todo list items and logs based on cron strings. I have scripts that save attachments to various places based on what's in my build files. None of these things are "features" of nmh. They're just little scripts that I hacked together with grep, sed, awk, and the shell. And every time I write one, I feel like a genius. The whole system just delights me. I want everything in my life to work like this program.

Okay, I know what you're thinking: "Scripting. Isn't that, like, _programming?_ I don't want/know how to do that." This objection is going to keep re-appearing, so let me say something about it right away.

The programming we're talking about for this kind of thing is very simple — so simple, that the skills necessary to carry it off could easily be part of the ordinary skillset of anyone who uses a computer on a regular basis. An entire industry has risen up around the notion that no user should ever do anything that looks remotely like giving coded instructions to a machine. I think that's another big con, and some day, I'll prove it to you by writing a tutorial that will turn you into a fearsome shell hacker. You'll be stunned at how easy it is.

For now, I just want to make the point that once you move to the command line, everything is trivially connected to everything else, and so you are mostly freed from being locked in to any particular type of tool. You can use a todo list program that makes Omnifocus look like Notepad. You can use one that makes Gmail Tasks look like the U.N. Charter. Once we're in text land, the output of any program can in principle become the input to any other, and that changes everything.

In the next installment, I'll demonstrate.

[Greetings ProfHacker fans. Yes, this post is a little rantish; the conversation continues in a more sober, expansive vein with [The Mythical Man-Finger][3] and [The Man-Finger Aftermath][4]. Thanks to one and all for the many comments, which have deepened my thinking on all of this considerably.]

[1]: http://www.nongnu.org/nmh/
[2]: http://ra.tapor.ualberta.ca/~dayofdh2010/stephenramsay/2010/03/14/hello-world/
[3]: /2011/07/25/the-mythical-man-finger/
[4]: /2011/08/05/the-man-finger-aftermath/

  [*rand]: Research ANd Development
  [*gui]: Graphical User Interface
  [*ajax]: Asychronous JavaScript and XML
  [*cli]: Command-Line Interface