Linux in a Nutshell, Third Edition
by Ellen Siever, Stephen Spainhour, Jessica P. Hekman, Stephen Figgins
Name
history
Synopsis
history [options]
history [lines]
Description
Print a numbered command history, denoting modified commands with a *. Include commands from previous sessions. You may specify how many lines of history to print.
Options
- -a [file]
bash maintains a file called .bash_history in the user’s home directory, a record of previous sessions’ commands. Ask bash to append the current session’s commands to .bash_history or to file.
- -c
Clear history list: remove all previously entered commands from the list remembered by the shell.
- -n [file]
Append to the history list those lines in the .bash_history file or in file that have not yet been included.
- -r [file]
Use .bash_history or file as the history list, instead of the working history list.
- -s command
Add command to working history list without executing it.
- -w [file]
Overwrite .bash_history or file with working history list.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access