LFCS · Question #800
Which of the following files, located in the user home directory, is used to store the Bash history?
The correct answer is A. .bash_history. The Bash shell stores a user's command history in the .bash_history file, which is located in their home directory.
Question
Options
- A.bash_history
- B.bash_histfile
- C.history
- D.bashrc_history
- E.history_bash
How the community answered
(60 responses)- A92% (55)
- B2% (1)
- D5% (3)
- E2% (1)
Why each option
The Bash shell stores a user's command history in the `.bash_history` file, which is located in their home directory.
The `.bash_history` file, typically found in a user's home directory (`~/.bash_history`), is the default location where the Bash shell saves a record of previously executed commands.
`.bash_histfile` is not the standard or default filename used by Bash for storing command history.
While `.history` might be used by other shells (like `csh` or `tcsh`), it is not the default history file for Bash.
`.bashrc_history` is not the standard or default filename for Bash history; `.bashrc` is a configuration file.
`.history_bash` is not the standard or default filename used by Bash for storing command history.
Concept tested: Bash history file location
Source: https://www.gnu.org/software/bash/manual/bash.html#History-Expansion
Topics
Community Discussion
No community discussion yet for this question.