Difference between revisions of "Sort/Uniq"
Jump to navigation
Jump to search
(Created page with "Category:Linux/Unix ;sort <filename> ;cat <filename>|sort :Print the content of <filename> sorted. ;sort -u :Sort and print all unique values ;uniq -d :Print all values...") |
|||
(One intermediate revision by the same user not shown) | |||
Line 7: | Line 7: | ||
;sort -u | ;sort -u | ||
:Sort and print all unique values | :Sort and print all unique values | ||
+ | |||
+ | ;sort -n | ||
+ | :sort numeric | ||
+ | |||
+ | ;sort -t"," -k3 | ||
+ | :Sort on the 3rd field using ',' as field seperator | ||
;uniq -d | ;uniq -d |
Latest revision as of 13:48, 22 August 2023
- sort <filename>
- cat <filename>|sort
- Print the content of <filename> sorted.
- sort -u
- Sort and print all unique values
- sort -n
- sort numeric
- sort -t"," -k3
- Sort on the 3rd field using ',' as field seperator
- uniq -d
- Print all values that exist more than once
- uniq -D
- Print all lines with duplicate values