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...
Pass with Confidence.
IT & Cybersecurity Package
You have hit the limits of our free tier, become a Premium Member today for unlimited access.
Military, Healthcare worker, Gov. employee or Teacher? See if you qualify for a Community Discount.
Monthly
$19.99
$19.99/mo
Billed monthly, Cancel any time.
3 Month Pass
$44.99
$14.99/mo
One time purchase of $44.99, Does not auto-renew.
MOST POPULAR
Annual Pass
$119.99
$9.99/mo
One time purchase of $119.99, Does not auto-renew.
BEST DEAL
Lifetime Pass
$189.99
One time purchase, Good for life.
What You Get
All IT & Cybersecurity Package plans include the following perks and exams .