Linux common Text processing small little tools

Source: Internet
Author: User

I. Common Text Processing tool commands

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 DELIMITER: Indicates delimiter, default tab-f fileds: #: # field #,#[,#]: Discrete multiple fields, such as 1,3,6 #-#: Continuous multiple fields, for example 1-6 blending makes By: 1-3,7-c--output-delimiter=string Specifies the output delimiter to display the specified column of the file or stdin data cut-d:-f1/etc/passwd cat/etc/p asswd | cut-d:-f7 cut-c2-5/usr/share/dict/words

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

Tail Command:

Option:-N #: Display after n rows-f: Output append data to screen tail-n 0-f/var/log/messages & #只显示追加的数据 cancel the day after tomorrow ~] #fg1即可

Head command:

Option:-N #: Displays the first n rows-C: Specifies the pre-fetch # bytes

More names:

More [options] file [...] More file This command does not support the page before you want to

Less command:

Less-opposite of more less command supports front and back page, and other matching methods

Paste command:

paste [option]... [file]...    -d  delimiter: Specify delimiter, default with tab    - s :  all rows of the composite line display     paste f1 f2    paste  - S f1 f2[email protected] ~]# paste /etc/fstab /etc/issue\s#kernel \r  on an \m# /etc/fstab# Created by anaconda on Tue Jul  19 14:39:24 2016## accessible filesystems, by reference, are  maintained under  '/dev/disk ' # see man pages fstab (5),  findfs (8),  mount (8)  and/or blkid (8)  for more info#uuid=f83c52ce-5740-4f02-bb87-6e190360dc30 /                         xfs     defaults  0 0uuid= c98144e4-d1b4-45b1-bb22-3112420ea487 /boot                    xfs     defaults  0 0uuid= dbf5c483-133e-4888-bbb1-a9622d83a930 swap                     swap    defaults  0  0#end[[email protected] ~]#

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/1834891

Linux common Text processing small little tools

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.