Multiple choice technology operating systems

Which command displays the value of the HOME variable?

  1. echo $HOME
  2. echo "$HOME"
  3. echo HOME

  4. echo `$HOME`
Reveal answer Fill a bubble to check yourself
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.