3 ms·
This works for me in zsh on OSX history \ | sed "s/^[0-9 ]//" \ | perl -pe 's/ \| */\n/g' \ | gawk '{counts[$1] += 1} END { for (x in counts) { print counts[x]
by NyxWulf 13y ago
This works for me in zsh on OSX
history \
| sed "s/^[0-9 ]//" \
| perl -pe 's/ \| */\n/g' \
| gawk '{counts[$1] += 1}
END { for (x in counts) { print counts[x],x}}' OFS="\t" \
| column -t \
| sort -k 1,1nr \
| head -100
Ok not sure how to format this on HN
https://gist.github.com/nyxwulf/5608955#file-gistfile1-sh https://gist.github.com/nyxwulf/5608955#file-gistfile1-sh