Why is the tilde key (~) the home directory in Linux?

May 13, 2021 by - Uncategorized

When you start learning Linux/UNIX command-line interface on your own, there’s a lot of foreign seeming things that you have to learn. It makes you wonder, who in the world came up with that idea? A lot of design choices seem so random and arbitrary, and are sometimes frustrating to try and memorize without any apparent reason for their selection. However, a lot of the strange and arbitrary seeming choices apparent have reasons behind their implementation.

Going back to the (good?) old days:

UNIX was developed in the 1970s at Bell Labs by Dennis Ritchie, Ken Thomson, and others. A lot of the fundamental system decisions for fundamental functionality in UNIX (from which Linux was later derived) occurred during the early stages of development. UNIX was developed on what were called “minicomputers” at the time. They were “mini” only in comparison to the gargantuan mainframe computers that proliferated in the earlier decades. Minicomputers were still fairly large compared to common computers of today (later termed “microcomputers”), and usually resided in a large rack alongside tape drives, 8″ floppy drives, and punch card/tape readers.

Photo of PDP-8 Exhibit, Living Computers Museum+Labs

Interaction with these large machines could be accomplished by using a teletype machine (pictured on the left in the above photo), or a terminal (pictured on the right). A terminal is basically just a dumb input/output device. The terminal takes user input from it’s keyboard, relays that to the computer, and displays the computer output to a screen (the command prompt you see on a modern Linux/UNIX machine operates in a similar way, as a “pseudo-terminal”).

The Lear-Siegler ADM-3A Terminal:

The LSI ADM-3A was released in 1976 and became popular due to its low cost at the time ($995). The University of California, Berkeley replaced their Teletype Model 33 machines with the ADM-3A. As such, a lot of research and software began to be written on these devices.

Lear-Siegler (LSI) ADM-3A Terminal, Chris Jacobs via Wikipedia

If you take a closer look at the ADM-3A, especially at the keyboard, you can spot something interesting:

ADM-3A keyboard, vintagecomputer.ca

The “Home” key is also the tilde “~” key! Why wouldn’t a programmer use a single symbol to represent the home directory, especially when the key on the machine they are developing on is labeled like this. Those familiar with vi will also notice that the H, J, K, and L keys, which are typically used for navigation, are labeled with directional arrows as well. There were no such thing as dedicated arrow keys back then!

It’s fascinating (to me at least) to see these decisions made 45 years still be carried through today. In fact, a lot of UNIX functionality developed in the early days remains as well. This is a testament to the staying power of UNIX and UNIX-like systems (a.k.a. Linux). It’s easy to observe lots of things that change, evolve, or simply are discarded as a technology progresses. It’s nice to see something that has been carried through from the beginning.

Tags: , , , , , ,

Leave a Reply

Your email address will not be published. Required fields are marked *