Linux commands, cut,sort,wc,uniq,tee instructions

Source: Internet
Author: User

cut : Intercepts a field

Syntax: cut-d "separator character" [-CF] n here n is the number

-D: followed by delimited characters, delimited by double quotation marks

-C: followed by the first few characters

-F: The next section is followed by the number of blocks

-D followed by the delimiter character, where a colon is used as the split character, and-F 1 is the first paragraph, and the space between-F and 1 is optional.

The-C can be either 1 digits n or an interval n1-n2, or multiple digits n1,n2,n3

Sort: Used for sorting

Syntax: sort [-t delimiter] [-KN1,N2] [-NRU] Here's N1 < N2

-T delimiter: function with the-D one meaning of cut

-N: Sorting with pure numbers

-R: Reverse Sort

-U: To repeat

-KN1,N2: Sorted by N1 interval to N2 interval, can only write-kn1, sort N1 field

WC : Statistics The number of lines, characters, and words of a document, the commonly used options are:

-L: Count rows

-M: Statistics of characters

-W: Number of statistical words

uniq : To repeat the line, the author used only one of the options:

-C: Count the number of repeated rows and write the number of lines in front

There is a point to note that before the uniq, you need to sort and then uniq, otherwise you will not get what you want, the author of the above experiment has been sorted so omitted that step.

Tee : followed by the file name, similar to redirect ">", but the specific gravity of a function, the file is written in the following file, while also displayed on the screen.

Linux commands, cut,sort,wc,uniq,tee instructions

Related Article

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.