Find the Top 10 commands in your linux box!

history | awk '{print $2;}' | grep -v '^./' | sort -d | uniq -c | sort -nr | head -n 10

grep,  '-v' means invert-match,'^' specify the begin of a line.

sort, '-d' means dictionary order, '-n' means take the string as a number, '-r' means reverse.

uniq -c, can prefix lines by the number of occurences.

posted @ 2014-09-04 17:30  l3sl!e  阅读(124)  评论(0编辑  收藏  举报