Linux Commands | Misc | history Command History
history Command
The history command manages the history of commands used after logging in to Linux.
history Usage
$ history
Delete Previous History
$ history -c
History is stored in memory. When the .bash shell exits, such as when the system shuts down or the user logs out, the history is automatically saved to the .bash_history file in the home directory. You can also manually save the current history by using the -w option.
Save Current History to ~/.bash_history
$ history -w
If you want to delete all previous history, use both the -c and -w options to update the in-memory history and the .bash_history file.
$ history -c
$ history -w