Linux for the local to the weight

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.