Bird
0
0

Which of the following commands correctly exports a variable named PATH with value /usr/bin?

easy📝 Conceptual Q2 of 15
Linux CLI - Environment and Configuration
Which of the following commands correctly exports a variable named PATH with value /usr/bin?
Aexport PATH /usr/bin
Bexport PATH=/usr/bin
Cexport =PATH /usr/bin
Dexport /usr/bin PATH
Step-by-Step Solution
Solution:
  1. Step 1: Recall correct syntax for export

    The correct syntax is export VARIABLE=VALUE without spaces around the equals sign.
  2. Step 2: Check each option

    export PATH=/usr/bin uses correct syntax. Options B, C, and D have incorrect syntax or order.
  3. Final Answer:

    export PATH=/usr/bin -> Option B
  4. Quick Check:

    export syntax = export VARIABLE=VALUE [OK]
Quick Trick: No spaces around = when exporting variables [OK]
Common Mistakes:
  • Adding spaces around = in export
  • Reversing variable and value order
  • Using export without assignment

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes