Bird
0
0

Which sequence of commands is correct?

hard📝 Application Q15 of 15
Linux CLI - Navigating the File System
You want to write a script that lists all files in your home directory, then moves into the Documents folder inside home, and finally prints the current directory path. Which sequence of commands is correct?
Acd ~/Documents ls ~ pwd
Bls ~ cd ~/Documents pwd
Cpwd cd ~ ls Documents
Dls Documents cd ~ pwd
Step-by-Step Solution
Solution:
  1. Step 1: List files in home directory

    The command ls ~ lists files in the home directory.
  2. Step 2: Change directory to Documents inside home

    cd ~/Documents moves into the Documents folder inside home.
  3. Step 3: Print current directory path

    pwd shows the current directory, which should now be Documents.
  4. Final Answer:

    ls ~ cd ~/Documents pwd -> Option B
  5. Quick Check:

    List home, cd Documents, print path [OK]
Quick Trick: List home first, then cd Documents, then pwd [OK]
Common Mistakes:
MISTAKES
  • Changing directory before listing home files
  • Listing wrong folder
  • Printing path before changing directory

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes