Bird
0
0

If your home directory is /home/alice, what is the output of echo ~?

medium📝 Command Output Q4 of 15
Linux CLI - Navigating the File System
If your home directory is /home/alice, what is the output of echo ~?
A/home/alice
B~
C/root
D/home
Step-by-Step Solution
Solution:
  1. Step 1: Understand what echo ~ does

    The shell expands ~ to the current user's home directory path before echoing it.
  2. Step 2: Apply the user's home directory

    Since the home directory is /home/alice, the command outputs this full path.
  3. Final Answer:

    /home/alice -> Option A
  4. Quick Check:

    echo ~ outputs home path [OK]
Quick Trick: echo ~ prints your full home directory path [OK]
Common Mistakes:
  • Expecting output to be ~ literally
  • Confusing with root directory
  • Thinking it prints current directory

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes