Bird
0
0

You want to write a script that always starts in your home directory, then moves into a folder named projects inside it. Which sequence of commands is correct?

hard📝 Application Q15 of 15
Linux CLI - Navigating the File System
You want to write a script that always starts in your home directory, then moves into a folder named projects inside it. Which sequence of commands is correct?
Acd ~\ncd projects
Bcd projects\ncd ~
Ccd /projects\ncd ~
Dcd ..\ncd projects
Step-by-Step Solution
Solution:
  1. Step 1: Start in home directory

    Using cd ~ moves the shell to the user's home directory regardless of current location.
  2. Step 2: Move into 'projects' folder inside home

    After being in home, cd projects moves into the 'projects' folder located there.
  3. Final Answer:

    cd ~\ncd projects -> Option A
  4. Quick Check:

    Home then projects folder = cd ~ then cd projects [OK]
Quick Trick: Always cd ~ first to ensure starting at home [OK]
Common Mistakes:
  • Changing to projects before home, causing errors
  • Using absolute path /projects which may not exist
  • Using cd .. which goes up instead of home

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes