Bird
0
0

If your current directory is /var/log, what will be the output of the command pwd after running cd ../lib?

medium📝 Command Output Q4 of 15
Linux CLI - Navigating the File System
If your current directory is /var/log, what will be the output of the command pwd after running cd ../lib?
A/var/log/../lib
B/var/log/lib
C/lib
D/var/lib
Step-by-Step Solution
Solution:
  1. Step 1: Understand current directory and cd command

    Current directory is /var/log. The command 'cd ../lib' moves up one directory to /var, then into lib.
  2. Step 2: Determine new directory path

    Moving up from /var/log to /var, then into lib gives /var/lib.
  3. Final Answer:

    /var/lib -> Option D
  4. Quick Check:

    'cd ../lib' from /var/log = /var/lib [OK]
Quick Trick: '..' moves up one directory level [OK]
Common Mistakes:
MISTAKES
  • Appending lib inside current dir
  • Not resolving '..' to parent directory
  • Confusing absolute and relative paths

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes