Bird
0
0

You want to add /custom/bin to your PATH only for your current terminal session without affecting others. Which command should you use?

hard📝 Application Q15 of 15
Linux CLI - Environment and Configuration
You want to add /custom/bin to your PATH only for your current terminal session without affecting others. Which command should you use?
Aset PATH=/custom/bin:$PATH
Bexport PATH=/custom/bin:$PATH
Csudo export PATH=/custom/bin:$PATH
Decho '/custom/bin' >> ~/.bashrc
Step-by-Step Solution
Solution:
  1. Step 1: Identify session-only PATH change

    Using export PATH=/custom/bin:$PATH changes PATH only in current shell session.
  2. Step 2: Evaluate other options

    echo '/custom/bin' >> ~/.bashrc appends to .bashrc, affecting future sessions, not current only. sudo export PATH=/custom/bin:$PATH uses sudo unnecessarily and is invalid syntax. set PATH=/custom/bin:$PATH uses wrong command 'set'.
  3. Final Answer:

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

    Use export for session-only PATH change [OK]
Quick Trick: Use export to change PATH only in current session [OK]
Common Mistakes:
  • Editing .bashrc for immediate effect
  • Using sudo with export
  • Using wrong commands like set

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes