Skip to content

Instantly share code, notes, and snippets.

@techmaniack
Last active October 7, 2015 15:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save techmaniack/3184002 to your computer and use it in GitHub Desktop.
Save techmaniack/3184002 to your computer and use it in GitHub Desktop.
One liner to show the top ten commands used on the system
This one-liner will read the ~/.bash_history file and give the top ten most frequently used commands
$ cat ~/.zsh_history \
| cut -f2 -d ";"\
| cut -f1 -d " "\
| awk '{c [$1]++}END{for(j in c)print j,""c[j]""}'\
| sort -hr -k2\
| head \
| column -t
This one-liner will read the ~/.zsh_history file and give the top ten most frequently used commands
$ cat ~/.zsh_history | cut -f2 -d ";" | cut -f1 -d " " | awk '{c [$1]++}END{for(j in c)print j,""c[j]""}' | sort -hr -k2 | head | column -t
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment