DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

See Your Most Used Shell Commands

07.02.2007
| 7460 views |
  • submit to reddit
        Found <a href="http://lifehacker.com/software/how-to/turbocharge-your-terminal-274317.php">here.</a>

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

Comments

Snippets Manager replied on Wed, 2007/07/04 - 10:08pm

For the last three commands, couldn't you use sort -nr | head instead of sort -n | tail | sort -nr?