Bird
0
0

Which of the following commands correctly lists files in the user's home directory using the shortcut?

easy📝 Syntax Q12 of 15
Linux CLI - Navigating the File System
Which of the following commands correctly lists files in the user's home directory using the shortcut?
Als ~
Bls ./home
Cls /home
Dls /root
Step-by-Step Solution
Solution:
  1. Step 1: Identify the shortcut for home directory

    ~ is the shortcut for the current user's home directory, so ls ~ lists files there.
  2. Step 2: Check other options

    /home is the parent folder for all users, ./home is a relative path that may not exist, and /root is root user's home, not current user.
  3. Final Answer:

    ls ~ -> Option A
  4. Quick Check:

    ls ~ lists home files [OK]
Quick Trick: Use ls ~ to list your home files quickly [OK]
Common Mistakes:
MISTAKES
  • Using absolute path /home instead of ~
  • Confusing relative path ./home with home directory
  • Trying to list /root which is for root user only

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes