Why Does ~ Represent the Home Folder on macOS and Linux?

Whether you’ve installed the Linux subsystem on Windows 10 or are getting started using the Linux Terminal, there are all kinds of shorthands you need to learn…none of which are intuitive.

For example there’s the tilde, ~, which represents your home folder. Typing cd ~/Documents switches to the Documents folder in the current user’s home directory, saving me from having to type /Users/justinpot/Documents every time. It’s a convenient shortcut, sure, but why is that particular character used for this?

Believe it or not, it’s because of a keyboard from the 1970s. Here’s a Lear Siegler ADM-3A terminal, first shipped in 1975.

This was a “dumb terminal,” meaning it wasn’t a computer in itself, but instead allowed you to input commands to and display data from a computer. The ADM-3A cost only $995, which believe it or not was a good price at the time, meaning institutions could purchase several such terminals to connect to one central computer. To this day, modern “terminal emulators,” such as those used in Linux and macOS, mimic functionality from such systems.

It’s a hugely influential piece of hardware; a lot of early software development happened on it, meaning the keyboard layout influenced a few design choices. Check it out:

Notice anything? Here’s a clearer image.

See the key at top-right? That’s the HOME key, which acts similarly to the Home key on modern keyboards, bringing the cursor to the top-left position while editing text. It’s also the key used for the tilde symbol: ~. That association was enough for ~ to eventually represent home folders.

That’s right: a specific keyboard from over forty years ago is why Linux and UNIX-based systems use ~ to represent home, even though the ~ and Home keys couldn’t be further apart on most modern keyboards. Weird, right?

And there are other details hidden in this keyboard. See the arrows on the H, J, K, and L keys? Holding Control and pressing those keys is how you moved the cursor in Terminal, which is why those same keys are used to move the cursor in vi. Those vi keyboard shortcuts, in turn, inspired the keyboard shortcuts in Gmail, Twitter and even Facebook. That’s right: even Facebook’s keyboard shortcuts were inspired by a “dumb terminal” first sold in 1975.

Look some more and you’ll notice see a few keys you don’t recognize at all. There’s the “Here Is” key, which blogger Dave Cheney explains here. Basically, it confirmed who you are over the network. You’ll also see that the Escape key is places where Caps Lock is on modern keyboards, which kind of puts the MacBook touch bar Escape key controversy in a new light. I’m sure there’s many other details I’m missing.

A device you’ve never heard of influenced design decisions used in software people still use over forty years later. Isn’t history weird?

Image Credits: Chris Jacobs, StuartBrady, Eric Fischer

Justin Pot is a staff writer for How-To Geek, and a technology enthusiast who lives in Hillsboro, Oregon. Follow him on Twitter and Facebook, if you want. You don't have to.