nerdexam
CompTIA

LX0-102 · Question #255

Which of the following commands will print the exit value of the previous command to the screen in bash?

The correct answer is A. echo $? See the full explanation below for the reasoning.

Question

Which of the following commands will print the exit value of the previous command to the screen in bash?

Options

  • Aecho $?
  • Becho $#
  • Cecho $exit
  • Decho $status
  • Eecho $&}

How the community answered

(56 responses)
  • A
    75% (42)
  • B
    13% (7)
  • C
    7% (4)
  • D
    4% (2)
  • E
    2% (1)

Community Discussion

No community discussion yet for this question.

Full LX0-102 Practice