#golfed OR "why use ruby -e when there's uniq -c." It's 40 chars shorter than before: cat ~/.bash_history | cut -d" " -f1 | sort | uniq -c | sort -rn | head

permalink

cat ~/.*h_h*|cut -d" " -f1|ruby -e'h=Hash.new 0;h[$_]+=1 while gets;h.each{|k,v|puts"#{v} "+k}'|sort -rn|head #golfed This snippet prints out my most frequently used commands

permalink