Sort, uniq, WC, cut essays in Linux

Source: Internet
Author: User

Sort command

Sorts the rows in the files specified by the file parameter and writes the results to standard output. If the file parameter specifies multiple files, the sort command connects the files and sorts them as a file.

Options and Parameters:
-F: Ignores case differences, such as a and a are treated as encodings;
-B: Ignores the first whitespace part;
-M: Sort by month name, such as JAN, DEC and so on;
-N: Sort using "pure number" (by default it is sorted by text type);
-R: Reverse sort;
-U: Is Uniq, in the same data, only one row is represented;
-T: delimiter, the default is to use the [tab] key to separate;
K: The meaning of sorting by that interval (field)

Uniq command

You can remove duplicate rows from a sorted file, so Uniq is often used in combination with sort. That is, in order for the Uniq to work, all duplicate rows must be contiguous.

Options and Parameters:
-I: Ignoring the difference between uppercase and lowercase characters;
-C: Counting
-U: only display unique rows

Cut command

  You can extract text columns from a text file or from a text stream.

Options and Parameters:
-D: followed by delimited characters. Used with-F;
-F: Divides a piece of information into several paragraphs according to the delimiter character of-D, and uses-F to remove the meaning of the paragraph;
-C: Remove the fixed character range in units of character (characters);

WC Command

The number of words in the statistics file, how many lines, how many characters.

Options and Parameters:
-L: Only the travel is listed;
-W: Lists only the number of words (English word);
-M: how many characters;

Sort, uniq, WC, cut essays in 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.