LoginSignup
121
74

More than 5 years have passed since last update.

#チルダ(~)って何を表すの?

Posted at

チルダ(~)はユーザのホームディレクトリを指す。

試しにターミナルを開いて以下のコマンドを実行すると

~/に移動
4dusers$ cd ~/
4dusers$ pwd
/Users/4dusers
/に移動
4dusers$ cd /
4dusers$ pwd
/

~/はユーザのホームディレクトリを指し
/はルートディレクトリを指しているのですね。

余談ですが、なぜUnix&Linuxでチルダがホームディレクトリを表現するのか、というのは昔のキーボードのレイアウトが関係あるそうです。
http://www.aivy.co.jp/BLOG_TEST/nagasawa/c/2013/01/unixlinux.html

そう言えばhjklの位置に矢印がついてるキーボードが昔あったような。

121
74
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
121
74