menu E4b9a6's blog
rss_feed
E4b9a6's blog
有善始者实繁,能克终者盖寡。

Linux命令行使用频率统计

作者:E4b9a6, 创建:2022-07-19, 字数:661, 已阅:170, 最后更新:2022-07-19

这篇文章更新于 857 天前,文中部分信息可能失效,请自行甄别无效内容。

Bash
history | awk '{CMD[$2]++;count++;}END { for (a in CMD)print CMD[a] " " CMD[a]/count*100 "% " a;}' | grep -v "./" | column -c3 -s " " -t | sort -nr | nl | head -n10

使用输出如下

Bash
➜  ~ history | awk '{CMD[$2]++;count++;}END { for (a in CMD)print CMD[a] " " CMD[a]/count*100 "% " a;}' | grep -v "./" | column -c3 -s " " -t | sort -nr | nl | head -n10
     1  542  14.7443%    sudo
     2  303  8.24266%    ll
     3  299  8.13384%    cd
     4  294  7.99782%    adb
     5  268  7.29053%    vim
     6  138  3.75408%    bash
     7  112  3.04679%    yay
     8  109  2.96518%    ping
     9  107  2.91077%    cat
    10  93   2.52992%    scrcpy

[[replyMessage== null?"发表评论":"发表评论 @ " + replyMessage.m_author]]

account_circle
email
web_asset
textsms

评论列表([[messageResponse.total]])

还没有可以显示的留言...
gravatar
[[messageItem.m_author]] [[messageItem.m_author]]
[[messageItem.create_time]]
[[getEnviron(messageItem.m_environ)]]
[[subMessage.m_author]] [[subMessage.m_author]] @ [[subMessage.parent_message.m_author]] [[subMessage.parent_message.m_author]]
[[subMessage.create_time]]
[[getEnviron(messageItem.m_environ)]]