When you type cd
, it basically does the same thing as cd ~
. Why?
I'm wondering if it's just a hard-coded behavior or if bash is expanding the command or something.
That is the POSIX specified behaviour. Not bash-specific.
cd
is one of the few builtins that is common to every shell since Unix version 7.
Commented
May 8, 2013 at 19:55
tcsh
and fish
are well alive. zsh
is POSIX-like but not POSIX compliant and is the Unix shell used by most people who actually /use/ a shell (as their main interface to the system).
Commented
May 9, 2013 at 7:14
man cd
: If no directory operand is given and the HOME environment variable is set to a non-empty value, the cd utility shall behave as if the directory named in the HOME environment variable was specified as the directory operand.