command history
The numbered list of commands you have typed, which bash keeps and saves to a file when the shell exits.
Secrets typed as command arguments are saved in plain text in the history file.
In more detail
The up and down arrows walk through it and the history builtin prints it with numbers. It is written to ~/.bash_history by default, so avoid typing passwords or tokens on the command line.
Example
history 5Related terms
- history expansion — Interactive shortcuts starting with an exclamation mark that reuse earlier commands, such as a double exclamation mark for the whole previous line.
- reverse history search — Pressing Control and R at the prompt to search backwards through your command history as you type.
- interactive shell — A shell reading commands from you at a terminal, as opposed to a non-interactive shell running a script.
Taught in
- Help, History, Completion And Aliases — Bash Scripting & Command Line Automation
- Variables, The PATH And The History — LPIC-1 Linux Administrator (101-500 and 102-500) Exam Prep