1. Format
Uniq [OPTION] ... [INPUT [OUTPUT]]
2. Command
-C,--count prefix lines by the number of occurrences-D,--repeated only print duplicate lines-D,--all-repeated[=delimit-Method] Print all duplicate lines delimit-method={none (default), prepend,separate} delimiting is DoneWith Blank Lines-F,--skip-fields=N Avoid comparing the first n fields-I.,--ignore- CaseIgnore differencesinch CaseWhen comparing-S,--skip-chars=N Avoid comparing the first n characters-U,--unique only print unique lines-Z,--zero-terminated end lines with0 byte, not newline-W,--check-chars=N Compare No Morethan N charactersinchLines--Help display this help and exit--version output version information and exit
3. Give examples
Unique.txt
Hellopythonhellopythonpythonbbs.pythontab.compythonpythontab.compythonhello.pythontab.comhellopythontabhellopythontab
(1) Performing Uniq Unique.txt
Hellopythonpythonbbs.pythontab.compythonpythontab.compythonhello.pythontab.comhellopythontab
(2) Does it feel right to look at it? Re-execute Uniq-c unique.txt
2 Hellopython 1 python 1 bbs.pythontab.com 1 python 1 pythontab.com 1 python 1 hello.pythontab.com 2 Hellopythontab 1 #感觉还是不对, Uniq checks for duplicate rows, is checked by adjacent lines #
(3) Perform sort unique.txt again | Uniq-c
1 1 bbs.pythontab.com 2 Hellopython 2 Hellopythontab 3 python 1 pythontab.com 1 hello.pythontab.com
---------------------
Eof
Linux for the local to the weight