Skip to main content

Linux command: history

For illustration: History

history - recall lines of previous typed input

$ history

List the last 5 commands

$ history -5

Clear history

$ history -c

The last command

$ !!
$ !-1

The command line N

$ !N

Tips and Tricks

Put a space before command to prevent it from being saved in history

Related commands

Powershell: Get-History