I have often wondered why the ~
(tilde) character represents the home directory of a user.
Is there a reason behind this, or is it just because tilde is an infrequently used character?
I have often wondered why the ~
(tilde) character represents the home directory of a user.
Is there a reason behind this, or is it just because tilde is an infrequently used character?
On Unix-like operating systems (including BSD, GNU/Linux and Mac OS X), tilde often indicates the current user's home directory: for example, if the current user's home directory is
/home/bloggsj
, thencd
,cd ~
,cd /home/bloggsj
orcd $HOME
are equivalent. This practice derives from the Lear-Siegler ADM-3A terminal in common use during the 1970s, which happened to have the tilde symbol and the word "Home" (for moving the cursor to the upper left) on the same key.
You can find photos of the Lear-Siegler ADM-3A keyboard on this site.
This terminal is also the source of the movement commands used in the vi
editor: h, j, k, l for left, down, up, right.
Esc
is used to switch modes in vi
, since the key is easy to reach on this type of keyboard.
– Justin Ethier
Mar 16 '12 at 15:27
Some teleprinters had a "Here is" key, which transmitted a fixed sequence 20 or 22 characters [...] This was commonly used to identify a station; the operator could press the key to send the station identifier to the other end
. Source: http://en.wikipedia.org/wiki/Teleprinter#.22Here_is.22_key
– pbm
Jan 21 '13 at 15:53
j
key. This is probably why this moving scheme has always been such a pain to learn for me.
– YuppieNetworking
Nov 26 '13 at 14:59
',.pyf
)
– ctrl-alt-delor
Jul 13 '16 at 21:50
mkdir '~'
because you will forget escaping thisrm -rf ~
(worst day ever)! – cprn Nov 21 '15 at 16:40rmdir
. – ctrl-alt-delor Jul 13 '16 at 21:36