فهرست منبع

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.
Waldir Pimenta 8 سال پیش
والد
کامیت
fd5fb3562d
1فایلهای تغییر یافته به همراه4 افزوده شده و 0 حذف شده
  1. 4 0
      pages/common/uniq.md

+ 4 - 0
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`