Matthew Woehlke writes:
Is there an efficient implementation of 'sort | uniq -c | sort -n'? I
have a 4 GB core file I want to run 'strings' on, and the above is
really slow.
See Jon Bently, Don Knuth, Doug McIlroy, "Programming pearls: a
literate program", CACM 29, 6 (June 1986), 471-483
<http://doi.acm.org/10.1145/5948.315654>. Source code is included. I
think Knuth's solution will run rings around all the solutions
proposed so far, if you tune it right (see below).
Is there a way already in coreutils to do this? If not, would there
be any interest in adding such a method?
I dunno, it sounds pretty specialized. Though there may be some
interest in a combination "sort | uniq -c", I wouldn't think there'd
be any interest in combining all three.