I have often wondered why the ~ represents the home directory of a user. Is there a reason
history - Design question: Why was '~' chosen to represent the home directory? - Unix and Linux
なぜUnix&Linuxではホームディレクトリを「~」(チルダ)文字で表現するのか。
うーむ、最初っからそう習ったからなあ。かれこれもう30年弱疑問に思ったこともなかったよ。
ではその理由です。
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.
Lear-Siegler社のADM-3Aという端末のキーボードレイアウトはこんな感じになっているそうです。
右上に「Home」とラベルされたキーがありその下に「~」がありますね。なのでホームディレクトリが「~」で表現されるようになったそうです。へー(ちなみにHomeキーというのはカーソルを画面の一番左上に移動させるキーのようです)。
さらに矢印キーがH,J,K,Lのところにありますが、これがVim(vi)のカーソル移動キーになった理由のようです。
ADM-3A端末の写真はこちらのドイツ語のサイトで見ることができます。
viを作ったBill Joyがこの端末を使って開発したってことが書かれていました。
Bill Joy (Mitbegründer von Sun) entwickelte auf so einem Terminal die erste Fassung des Unix-Editors vi. Es war auch das erste Terminal mit Pfeiltasten, weshalb diese in vi bis heute noch eine grosse Rolle spielen. Ein Blick auf die Tilde (~) rechts oben könnte auch erklären, warum diese bis heute ins Home-Verzeichnis führt (cd ~)
上記をGoogle翻訳にかけて日本語にすると何がなんだかわからないので英語に翻訳したものを載せます。
Bill Joy (co-founder of Sun) developed in such a terminal, the first version of the UNIX vi editor. It was also the first terminal with the arrow keys, so this in vi to still play a big role. A look at the tilde (~) right above could also explain why this leads to the present in the home directory (cd ~)
いろいろ「なるほどなあ」って感じです。