In Bash, which file typically stores the command history?

Prepare for the Certified Ethical Hacker Version 11 Exam with a comprehensive test featuring flashcards and multiple choice questions, each accompanied by hints and explanations to ensure a thorough understanding. Ace your ethical hacking exam with confidence!

Multiple Choice

In Bash, which file typically stores the command history?

Explanation:
In Bash, the command history is saved to a file defined by the HISTFILE variable, which is normally the hidden file in your home directory called .bash_history. This is why the expected history file is ~/.bash_history: it’s the standard storage location Bash uses to persist commands between sessions. The shell also keeps a running in-memory history during a session and writes it to HISTFILE when you exit. You can view history with the history command, and you can customize where it’s stored (HISTFILE) or how many entries are kept (HISTSIZE for memory and HISTFILESIZE for the file). Other options aren’t Bash’s default history file names: history.txt isn’t standard, .bashrc is for initialization, and bash_history isn’t the typical filename.

In Bash, the command history is saved to a file defined by the HISTFILE variable, which is normally the hidden file in your home directory called .bash_history. This is why the expected history file is ~/.bash_history: it’s the standard storage location Bash uses to persist commands between sessions. The shell also keeps a running in-memory history during a session and writes it to HISTFILE when you exit. You can view history with the history command, and you can customize where it’s stored (HISTFILE) or how many entries are kept (HISTSIZE for memory and HISTFILESIZE for the file). Other options aren’t Bash’s default history file names: history.txt isn’t standard, .bashrc is for initialization, and bash_history isn’t the typical filename.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy