Saki's 研究记录

查看自己在 Linux/Mac 下常用的命令

字数统计: 191阅读时长: 1 min
2021/10/19

看看你在Linux下最常用的命令是哪些? 在Linux或者Mac的Terminal下执行下面的命令就可以:

1
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

Show 一下我在 MBP 上的历史命令:

1
2
3
4
5
6
7
8
9
10
11
sakishum$ 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 359 71.8% fish
2 14 2.8% go
3 9 1.8% docker
4 7 1.4% ssh
5 3 0.6% find
6 3 0.6% cd
7 2 0.4% sudo
8 2 0.4% mv
9 2 0.4% fidh
10 2 0.4% curl

没有用啥高级命令唏嘘

Done.

CATALOG