Which two commands disable and then re-enable shell history recording?

Study for the OSCP Linux Exam. Use our flashcards and multiple-choice questions to test your skills. Each query comes with detailed hints and explanations to enhance your preparedness. Get ready to conquer the exam!

Multiple Choice

Which two commands disable and then re-enable shell history recording?

Explanation:
History recording is controlled by a shell option that you can toggle with the set builtin. In Bash, you enable the option with set -o history and disable it with set +o history. When history recording is disabled, new commands you run aren’t appended to the in-session history or saved to the history file, and when you re-enable it with set -o history, recording resumes. The other options shown affect existing history entries or how much history is kept (or where it’s saved) but don’t provide a direct on/off switch for recording like these two commands do.

History recording is controlled by a shell option that you can toggle with the set builtin. In Bash, you enable the option with set -o history and disable it with set +o history. When history recording is disabled, new commands you run aren’t appended to the in-session history or saved to the history file, and when you re-enable it with set -o history, recording resumes. The other options shown affect existing history entries or how much history is kept (or where it’s saved) but don’t provide a direct on/off switch for recording like these two commands do.

Subscribe

Get the latest from Passetra

You can unsubscribe at any time. Read our privacy policy