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.

上一篇:centos7下安装docker(9.1容器对资源的使用限制-CPU)


下一篇:Java实现二分法(折半)查找数组中的元素