Get Unique Line Counts on Linux

From terminal:

cat Duplicates.txt | sort | uniq -c > Counts.txt

Within vi:

:%sort         // sort the results as required by "uniq"
:%!uniq -c   // use the *nix "uniq" tool to prepend counts
:%sort!        // sort in reverse order

Comments