During a security-hardening exercise, you are asked to configure a service account's Bash environment so that users can still recall commands in the current session, but no history is ever written to ~/.bash_history when they log out. Which Bash environment variable should you unset or set to an empty value in the account's shell profile to meet this requirement?
Bash saves the in-memory history list to the file named by the HISTFILE variable when the shell exits. If HISTFILE is unset or set to a null value (for example, export HISTFILE="" or export HISTFILE=/dev/null), the write operation is skipped, so nothing is stored on disk, while the history list remains available during the session.
HISTSIZE limits how many commands are kept in memory; setting it has no effect on whether the file is written. HISTCONTROL only filters what gets saved, and HISTFILESIZE limits how many lines are retained in the file once it is written. None of those variables stop Bash from opening or updating the history file, so they do not satisfy the requirement.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What does the HISTFILE variable control in Bash?
Open an interactive chat with Bash
How is HISTSIZE different from HISTFILE?
Open an interactive chat with Bash
What is the purpose of the HISTCONTROL variable in Bash?
Open an interactive chat with Bash
CompTIA Linux+ XK0-006 (V8)
Security
Your Score:
Report Issue
Bash, the Crucial Exams Chat Bot
AI Bot
Loading...
Loading...
Loading...
IT & Cybersecurity Package Join Premium for Full Access