Bird
0
0

A user runs cd ~username but gets an error. What is the likely cause?

medium📝 Debug Q14 of 15
Linux CLI - Navigating the File System
A user runs cd ~username but gets an error. What is the likely cause?
AThe home directory is not mounted
BThe tilde shortcut only works for current user
CThe command syntax is incorrect
DThe username does not exist on the system
Step-by-Step Solution
Solution:
  1. Step 1: Understand ~username usage

    ~username expands to the home directory of the specified user if that user exists.
  2. Step 2: Identify error cause

    If the username does not exist, the shell cannot expand ~username, causing an error.
  3. Final Answer:

    The username does not exist on the system -> Option D
  4. Quick Check:

    ~username needs valid user [OK]
Quick Trick: Check if username exists before using ~username [OK]
Common Mistakes:
MISTAKES
  • Assuming ~ only works for current user
  • Thinking syntax is wrong when it is correct
  • Ignoring user existence in error

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes