To get the top 10 most used shell commands, run history | awk '{print $2}' | sort | uniq --count | sort --numeric-sort --reverse | head -10 explained: history # List all commands from history file awk '{print $2}' # print the second field sort # sort alphabetically uniq --count # combine consecutive duplicates and count how many there are. requires sort before so it captures all of them correctly sort --numeric-sort --reverse # sort by the count in descending numeric order head -10 # print the first 10 entries