Re:LINQ Ruined My Favorite Interview Question
by kragen on Friday July 12, 2013 @01:35AM
(#6031101)
You can use tr instead of sed and grep, too. Also -k1 and -n 10 are default for sort and head:
$ < bible-pg10.txt tr -cs a-zA-Z '\n' | sort | uniq -c | sort -nr | head
62265 the
38915 and
34588 of
13474 to
12846 And
12589 that
12387 in
9762 shall
9668 he
8942 unto
I have a `bins` script that is just `sort | uniq -c | sort -nr`, so that reduces to `tr -cs a-zA-Z '\n' | bins | head`.
Unix for Poets, man. It's the shit.