3 ms·
Obviously you could create a shell alias or write a new utility for that -- but if you're wondering why there isn't a standard UNIX utility for doing that: All
by cperciva 4y ago
Obviously you could create a shell alias or write a new utility for that -- but if you're wondering why there isn't a standard UNIX utility for doing that: All the standard text processing utilities were designed in the context of processing files which didn't fit into memory -- with the exception of sort (which uses temporary files) they're all streaming utilities which keep at most a handful of lines in memory at once.
The "normal" way of doing "count how many times lines are present and list them in decreasing order" is to use a hash table which keeps all the (unique) lines in memory -- so that utility simply wasn't possible when all the standard tools were invented.