$HOME
–
Location of the user’s home directory
$HOME contains the path of the current user’s home directory.
It’s used in tilde expansion.
$HOME is also used as the default argument for the cd command.
Links
Examples
- Output the path to the current user’s home directory.
1echo "$HOME"- Tilde expansion for the current user
1echo ~- Tilde expansion for another user
1echo ~jane
BashSupport Pro is a Bash and POSIX IDE with support for $HOME – try it now!