List and run last used commands in Linux

To list through most recently used commands one by one use Arrow-Up key

To display all used commands:
history

To run a command from the history list:
!391
where 391 command number

To find a particular command in your history:
history | grep command
where command part of the command you are after

Your history is saved in a file:
/root/.bash_history
where root your user name