variable
Bash HOME — home directory
Usually the user home directory, used by cd without an operand and tilde expansion. Do not assume the actual path or print private environment data.
Formal Syntax & Structure
bash syntaxbash
$HOMEReturn Value
string
Home directory value.
Working Example
Example Snippetbash
printf 'home=%s\n' "$HOME"cd /printf 'pwd=%s\n' "$PWD"