Bird
0
0

You have a nested directory structure: /home/user/projects/app. From /home/user/projects/app, which relative path correctly accesses the file /home/user/docs/readme.md?

hard📝 Application Q9 of 15
Linux CLI - Navigating the File System
You have a nested directory structure: /home/user/projects/app. From /home/user/projects/app, which relative path correctly accesses the file /home/user/docs/readme.md?
A../docs/readme.md
B../../docs/readme.md
C../../../docs/readme.md
D./docs/readme.md
Step-by-Step Solution
Solution:
  1. Step 1: Calculate directory levels to move up

    From /home/user/projects/app, '..' moves up one level. Two '..' moves up to /home/user.
  2. Step 2: Append path to target file

    After moving up two levels, append 'docs/readme.md' to reach the file.
  3. Final Answer:

    ../../docs/readme.md -> Option B
  4. Quick Check:

    Two '..' from app leads to /home/user [OK]
Quick Trick: Count '..' to reach common ancestor directory [OK]
Common Mistakes:
  • Using too few '..' to reach target
  • Using './' which stays in current dir
  • Using too many '..' going above root

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes