Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

get my most used command from history

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
Source by superuser.com #
 
PREVIOUS NEXT
Tagged: #command #history
ADD COMMENT
Topic
Name
1+8 =