如何获取Bash命令历史记录统计信息,例如最近6个月中最常用的命令? [英] How to get Bash command history statistics, like the most used commands in the last 6 months?
本文介绍了如何获取Bash命令历史记录统计信息,例如最近6个月中最常用的命令?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
例如,在最近的6个月中,我如何查看bash中最常用的命令是什么?我可以将这些数据存储在某个地方吗?
How can I see, for example, what are my most used commands in the last 6 months in bash? Can I store this data somewhere?
推荐答案
history|awk '{print $2}'|awk 'BEGIN {FS="|"} {print $1}'|sort|uniq -c|sort -rn|head -30
从Arch Linux板上的一个线程
From a thread on the Arch Linux boards
这篇关于如何获取Bash命令历史记录统计信息,例如最近6个月中最常用的命令?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文