The Linux uniq command

Source: Internet
Author: User

Uniq-report or omit repeated lines omit duplicate rows

Parameters:

-I ignores the difference between uppercase and lowercase characters

-C to count repeated rows

Note: The Uniq command will only de-weight adjacent duplicate rows, so uniq is often used with the sort command, and the sort command can line up duplicate rows and then use Uniq to repeat the count

[Email protected] test]#Catc.txt aabaaabbbdb[[email protected] test]#CatC.txt |UniqAbabdb[[email protected] test]#CatC.txt |Uniq-c //only to the adjacent row to go to the weight 2a1b3a3b1D1B[[email protected] test]#CatC.txt |Sort|Uniq-c //combine the sort command with 5a5b1D[[email protected] test]# Last|Cut-D" "-f1|Sort|Uniq-C1       AChenyao6Chenyao13Oldgirl $reboot107Root1Wtmp[[email protected] test]#

The Linux uniq command

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.