The Sort,unip,cut of Linux

Source: Internet
Author: User

Sort the rows in a file with sort, or sort the results based on a given standard output. The following is a summary of the partial usage of sort.

Sort-d can make sort ignore punctuation and some other special characters, and then sort the rows in the file.

Sort-f can ignore the size of the letters, that is, the case is cross-sorted.

Sort-n indicates that sort is sorted by numeric value, because sort defaults to ASCII code.

Sort-r indicates that sort is reversed in ASCII order.

Sort also allows you to sort the rows in a file by using a field. The default delimiter for sort is a space, that is, a space or a tab.

Sort +3 Test.file +3 indicates that sort begins with the third delimiter, which is sorted by the fourth field. Equivalent to Sort-k 4 testfile

Sort-t:-N +2 test.file records are sorted by the third field that is worth the size. -T is the specified delimiter.


Uniq-c output All rows that are not identical. and display a number on the left side of each line indicating the number of times that the line was entered in total.

uniq-d outputs only one row of the repeating row, ignoring rows without duplicates.

Uniq-u outputs only rows that are not duplicates, ignoring duplicate rows.


The Sort,unip,cut of Linux

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.