QuestionQ88

Understanding Passwords

Which of these commands immediately terminates a UNIX shell session without saving its history?

  • A unset HISTFILE
  • B rm HISTFILE
  • C kill -9 $$
  • D rm $HOME/.bash_history
Explanation

kill -9 $$ sends the uncatchable SIGKILL signal to the current shell process ($$), so the process terminates immediately and cannot perform its normal exit processing. Bash normally saves enabled command history when it exits; normal history persistence is therefore bypassed by this forced termination.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!