Summary of common options for cat, cut, sort, uniq, WC, tr for Linux

Source: Internet
Author: User

First, the basic command

Cat command:

Cat [OPTION] ... [FILE] ...-A,--show-all equivalent to-vet-b,--number-nonblank to non-null output line number-e equivalent to-VE-E,--show-end s shows $-n at the end of each line,--number to all lines of output-s,--squeeze-blank does not output multiple lines of empty lines-T with-VT equivalent-T,--show-tabs will jump word modifier explicitly Shown as ^i-u (ignored)-V,--show-nonprinting uses ^ and M-references, except LFD and tab--HELP Display this Help message and leave


Cut command:

Cut OPTION ... [FILE] ...-d: Specify delimiter, default is space-F: Specifies the field to display-f1-f 1,3-f 1-3

Sort command:


Sort command: Sort [OPTION] ... [FILE] ... sort [option] ...--files0-from=f option:-N: Numeric sort-R: Reverse order-T: Sort by Field delimiter-K: Specify field to sort-U: Remove duplicate rows-F: Case insensitive


uniq Command:

Uniq command: report or ignore the same row uniq-report or omit repeated lines option:-D: Show only duplicate rows-D: Show all duplicate rows-C: Show only the number of repetitions


WC command:

Wc-print newline, Word, and byte counts for each file WC [OPTION] ... [FILE] ... wc [option] ...--files0-from=f option:-L: Display line number-C: Display number of characters-W: Displays the number of words-l: Shows the longest line contains how many characters-m: Displays the number of characters

TR command:

TR [OPTION] ... SET1 [SET2] option:-C replaces this character set with a complement to the character set in string 1, which requires the character set to be ASCII. -d deletes all input characters in string 1. -S Delete all occurrences of a sequence of characters, leaving only the first one; the string compression is about to recur to a string.

History command:

Option:-C: Empty command history-D: Delete specified row-w: Save command to History file


Note: because the website picture server reason picture cannot upload, later fill up.



This article is from "Wake up your not alarm clock but dream" blog, please be sure to keep this source http://purify.blog.51cto.com/10572011/1834086

Summary of common options for cat, cut, sort, uniq, WC, tr for 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.