One line command to list the top 10 common cmd in your device

如何查看终端中输入最多的10个命令


Copy the command below to terminal and return.

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

This command will count times of use for cmd in your device and list top 10 of them.

0 0 vote
Article Rating