Since ~
, .
and ..
are special directories, why are they handled differently in the following example?
$ echo ~
/home/tim
$ echo ..
..
$ echo .
.
~
is expanded into the dir, but the other two are not.- The other two are expanded literally, but
~
isn't.
~
is not a directory, it is a construct of your shell and does not truly exist. – casey Jul 31 '14 at 16:08.
is not (the name of) a directory either, but~
refers to your home directory as.
refers to the current directory and..
refers to the parent directory. – iconoclast Jan 16 '15 at 03:02