The article provides a command that shows the 10 most-frequently used terminal commands and the percentage of usages. I found it interesting, especially when I increased the count to the Top 25 (substitute -n10 with -n25) and commands that might be worthy of an alias or an AutoKey shortcut.
Code: Select all
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
Here is mine. I cleared history earlier in the week and I do not think the results here are a true representative. An example of atypical usage is the flatpak entry. I only have three flatpaks installed (darktable, GIMP and krita), and I almost never use them.
Code: Select all
1 139 13.9% ls
2 115 11.5% cd
3 73 7.3% ll
4 52 5.2% cat
5 36 3.6% curl
6 33 3.3% sudo
7 22 2.2% flatpak
8 21 2.1% htop
9 20 2% yelp
10 20 2% file
flatpak list
first ... so the flatpak command gets used twice.Also, ps and kill show up when I increased the count to 25, which makes sense. I use yelp to view man pages, and sometimes it does not exit properly.
The Reddit thread offers an additional command that shows the usage as a bar chart.
Code: Select all
history | tr -s ' ' | cut -d ' ' -f3 | sort | uniq -c | sort -n | tail | perl -lane 'print $F[1], "\t", $F[0], " ", "▄" x ($F[0] / 12)'