Low Orbit Flux Logo 2 F

Linux Command - History

The linux history command shows a list of previous commands with line numbers. Modified entries start with ‘*’;

Show history:



history

Show most recent 5 lines:



history 5

Clear history for current shell:



history -c

Overwrite history file:



history -w

Purge all history:



history -wc

Delete history entry at this offset:



history -d

History is saved here:



~/.bash_history

Set this variable to see the date and time for every command in history:



HISTTIMEFORMAT='%Y-%m-%d %T '

Add to .bashrc if you want to keep the setting:



~/.bashrc

export HISTTIMEFORMAT='%Y-%m-%d %T '