Files
website/content/blog/20240831-re-my_top_10_linux_commands.md

1.2 KiB

date, draft, tags, title
date draft tags title
2024-08-31T00:00:00-08:00 false
blog
Re: My Top 10 Linux Commands

I came across this post by Guillermo Garron sharing how to see your most used shell commands. The post says "Linux Commands", but this will work with any POSIX or POSIX adjacent shell. Just run the following command:

history | awk '{print $2}' | sort | uniq -c | sort -nr | head -n 10

I thought it would be fun and silly to share my results, which were:

1 history

The reason why there is only this one command in my top 10 list of most used commands is because I don't keep that history. My $HISTFILE is set to /dev/null, which helps keep my home folder clean of unnecessary files, and I believe that history is unnecessary. I keep a lot of notes for commands that I need to refer back to later, or I create shell scripts for commands that need to be repeatedly ran. This practice works for me because I feel like I am always starting with a clean slate, while still being able to quickly look up what I need to do with man-pages, my personal notes, or shell scripts.

Give it a try, delete your history!