Random UNIX oneliner of the day

2009-03-05 08:21:10

I was trying to count who said a certain word how often in an IRC channel, so I came up with this:

grep -i foobar .irssi/irclogs/channel.log | cut -d "<" -f 2 | cut -d ">" -f 1 | sed 's/[@ %*!]//' | sort | uniq -c | sort

It takes roughly 1.8sec for 150.000 lines. Will add a perl and awk version if I find time.

About

Life's a bitch, life's a whore. Nothing less, nothing more.

Read More