Erdal TAŞKESEN

How to list your most-used commands

19 April 2020

If you are a developer, you’re mostly working using the command line. You may even wanna find out the most used commands.

fc -l 1 | 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

You will see the output similar to this:

You may change the -n10 at the end if you want to see more results.

Tags: cli