In Ubuntu Linux, there are a few ways to display a list of recent commands. The most common way is to use the command “show commands”. This will show you a list of all the commands that have been used in the current session. You can also use the “search” command to find specific commands.


If you want to find a command that you used before but you have a huge history list, you can quickly find it by passing it through grep. Let’s say we remember typing the ftp command, but can’t remember the domain name of the server:

1 ps -ef2 kill 241883 ps -ef4 tail logfile.log

Pretty simple stuff! What if we want to display the list of items that we use the most often?  We can use a much more complicated command like this:

321 ftp ftp.cdrom18.com

The last command was thanks to Lifehacker, which is a great site you should definitely subscribe to.

114 ls105 ./runreports.sh97 cd24 uptime15 mysql13 vi

The techniques used in the last command are useful in other contexts. I’ll be posting more similar commands going forwards.