CompTIA Linux+ Practice Questions: Shell Configuration

5 free, exam-style CompTIA Linux+ (XK0-006) practice questions covering Shell Configuration, each with the correct answer and an explanation. Start a timed exam below, or scroll on to read through the questions.

🧠

Mini Exam

25 Questions · 50 minutes

Start Quiz 🚀
🏆

Mock Linux+ Exam

85 Questions · 165 minutes

Start Quiz 🚀
📅

Daily Quiz

10 Questions · 20 minutes

Start Quiz 🚀
🎯

Standard Practice

50 Questions · 100 minutes

Start Quiz 🚀

Shell Configuration practice questions

Answers and explanations are shown. Take the timed exam above to test yourself first.

Q1. Which file defines default shell variables?

  • A./etc/profile
  • B.~/.bashrc
  • C./etc/environment✓ Correct
  • D./etc/passwd
Explanation: /etc/environment sets system-wide environment variables. Learn more.

Q2. What command lists all environment variables?

  • A.env✓ Correct
  • B.set
  • C.export
  • D.echo $PATH
Explanation: env prints current environment variables. Learn more.

Q3. What does 'echo $?' display?

  • A.Current user
  • B.Last command's exit code✓ Correct
  • C.Environment variables
  • D.Process ID
Explanation: $? contains exit status of previous command. Learn more.

Q4. Which file defines system-wide aliases?

  • A./etc/bashrc✓ Correct
  • B./etc/profile
  • C./etc/aliases
  • D./etc/environment
Explanation: /etc/bashrc contains global bash settings. Learn more.

Q5. Which command shows environment variables?

  • A.env
  • B.set
  • C.printenv
  • D.All of the above✓ Correct
Explanation: All display environment variables in different formats. Learn more.

More CompTIA Linux+ practice topics

Keep studying CompTIA Linux+

Full CompTIA Linux+ practice exam · CompTIA Linux+ study guide · All CompTIA practice questions

Last updated