http://www.perlmonks.org?node_id=250395


in reply to speed up one-line "sort|uniq -c" perl code

you would gain a speed by using lesser processes in your bash one liner,instead of "sort |uniq":
sort -u
try to use nl for the line number:
sort -u | nl -ba
Update: bad answer .. this question was not asked .. thx Aristotle