Skip to main content
Linux AdministrationMediumSingle Choice

Linux Administration Question

Statement

Which Bash environment variable defines in which file the user history is stored when exiting a Bash process?

#histfile#bash_history#environment-variable#history-file
A

HISTORY

B

HISTFILE

Correct
C

BASH_HIST

D

LOGFILE

Resolution & Explanations

The HISTFILE environment variable specifies the file where the command history is saved when a Bash session ends. By default, this is ~/.bash_history. When Bash exits, it writes the history list to the file named by HISTFILE. If HISTFILE is unset, no history is saved.