statistics on yourLinuxSystem ofHistoryhistory to draw your favorite use of the former10a command
method One:awk Array Method
[[Email protected] ~]# history |awk ' {H[$2]++}end{for (key in H) Printkey,h[key]} ' |sort-rnk2|headawk 279ll 78cat 66cd 41ls 34find 32echo 32man 30sed 27vim 26
#优雅的显示可以加上 |column-t can
[[Email protected] ~]# history |awk ' {H[$2]++}end{for (key in h) print Key,h[key]} ' |sort-rnk2|head |column-tawk 279ll 78cat 66cd 41ls 34find 32echo 32man 30sed 27vim 26
Method Two: Simple treatment method
[[Email protected] ~]# history |awk ' {print $} ' |sort |uniq-c |sort-rn|head 279 awk ll LS-Find-echo-man sed-vim
if the execution of the awk array is still not understood, refer to the
http://lidao.blog.51cto.com/3388056/1912219
"4 months 8 days" value 18800 MySQL DBA High - energy must kill technology free to send you!
Http://mp.weixin.qq.com/s/nVP8s2oQw3arrK8Hyy6Ftw
This article is from the "Lee blog" blog, make sure to keep this source http://lidao.blog.51cto.com/3388056/1913185
Old boy Education Daily-April 5, 2017-Count your Linux system history to get the top 10 commands you'd like to use