Old boy Education Daily-April 5, 2017-Count your Linux system history to get the top 10 commands you'd like to use

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.