back toc next

Tilde Expansion

~
Expands to the Home-Directory (i.e. to $HOME)
~username
Expands to the Home of the user username
~+
Expands to the Present Working Directory (i.e. to $PWD or pwd)
~-
Expands to the old PWD (i.e. $OLDPWD)
~N
~+N
~-N
Expands to a path in the directory stack (view dirs, pushd, popd for details)

Example

echo My ~ is my castle