History is a great command to use, I use it daily, today I have found a real good application of it.

It is the way to list the most used commands by you.

Here is how, type this in the console:

history|awk '{print $2}'|awk 'BEGIN {FS="|"} {print $1}'|sort|uniq -c|sort -r

What this command does is to pass the output of history to awk, which prints only the second column of it, then it sorts it and count the occurrences of each command, finally it sorts the output in reverse order, so you have first your most used command and at last the least used one, if you want the opposite order try this one:

history|awk '{print $2}'|awk 'BEGIN {FS="|"} {print $1}'|sort|uniq -c|sort

You can use history also with grep, if you want to look for an specific command like:

mount /media/nfs

Which is too long to type again, and you may not remember it, so you can look for it using:

history | grep mount

but if you use it or other command a lot, is better to create an alias for it.

This article is inspired, and with info from: LifeHacker