Which command displays the value of the HOME variable?
-
echo $HOME
-
echo "$HOME"
-
echo HOME
-
echo `$HOME`
A
Correct answer
Explanation
In Unix shells, the dollar sign ($) prefix is used to expand variable values. 'echo $HOME' correctly expands the HOME environment variable and displays its value. Option B uses quotes which would literally print '$HOME' as text. Option C without the dollar sign prints the literal string 'HOME'. Option D uses backticks which attempt to execute the result of $HOME as a command, not print the variable value. The $ prefix is essential for variable expansion in shell scripting.