Bird
0
0

What will be the output of the command sequence?

medium📝 Command Output Q5 of 15
Linux CLI - Environment and Configuration
What will be the output of the command sequence?
export PATH=/usr/bin
export PATH=/bin:$PATH
echo $PATH
A/bin:/usr/bin
B/usr/bin:/bin
C/bin
D/usr/bin
Step-by-Step Solution
Solution:
  1. Step 1: Set PATH to /usr/bin

    First command sets PATH to /usr/bin.
  2. Step 2: Prepend /bin

    Second command prepends /bin to PATH, making it /bin:/usr/bin.
  3. Final Answer:

    /bin:/usr/bin -> Option A
  4. Quick Check:

    Prepending adds new dir before existing PATH [OK]
Quick Trick: Prepend with new_dir:$PATH [OK]
Common Mistakes:
  • Appending instead of prepending
  • Overwriting PATH without $PATH
  • Misreading echo output

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes