How to list most-used commands

Erdal TAŞKESENErdal TAŞKESEN
1 min read

If you are a developer, you’re mostly working using the command line. You may even want to 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

References

  1. https://www.gnu.org/software/bash/manual/bash.html
0
Subscribe to my newsletter

Read articles from Erdal TAŞKESEN directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Erdal TAŞKESEN
Erdal TAŞKESEN

Hey, y’all 🖖🏽 I am a passionate self-taught developer, open-source advocate, and tech enthusiast with a hands-on approach to problem-solving and an unending thirst for knowledge. Anything and everything classified as technology fascinate me.