From fd5fb3562d475e63575b61de47e080fc0b99f164 Mon Sep 17 00:00:00 2001 From: Waldir Pimenta Date: Sun, 10 Jul 2016 10:26:13 +0100 Subject: [PATCH] uniq: add sorting example (#945) This involves another command, but it's such a natural extension of uniq's `-c` functionality that I feel it's warranted to show here. We should probably add a sort to the -c example too, because uniq only deals with *sequential* line repetitions. --- pages/common/uniq.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pages/common/uniq.md b/pages/common/uniq.md index fb28858e6b..1ed819169a 100644 --- a/pages/common/uniq.md +++ b/pages/common/uniq.md @@ -17,3 +17,7 @@ - Display number of occurences of each line along with that line: `uniq -c {{file}}` + +- Display number of occurences of each line, sorted by the most frequent: + +`uniq -c {{file}} | sort -nr`