History Command

To view the list of previously typed commands you can use the bash built-in command history.

[root@localhost~]#history

You can recall commands using up and down arrow keys on your keyboard.

The ! key can be used to rerun a command.

example:

!x execute the latest command in the history list starting with an ‘x’

!2 runs commands number 2 from the history output

!x-2 runs the command before last

!! runs the last command


Leave a Reply