Linux Common Pipe Command __linux

Source: Internet
Author: User
1.cut, the data in a row is decomposed cut-d ' separator '-f fields cut-c character range-F to remove the meaning of paragraph, starting from 1: Echo $PATH | Cut-d ': '-F 3,5 Export | Cut-c 12-
2.grep profiling a row of data grep [-ACINV] [--color=auto] ' string ' filename-c calculate the number of times to find a string-I ignore case-n, by the way, output line number-V reverse selection, and output lines without string--co Lor=auto will find string plus color display
3.sort, sorted sort [options] [file or stdin]-f: Ignore case-B: Ignore the first space-m: January name to sort-N: Use numeric sorting (default text type)-r: Reverse sort-u:uniq, same data output row -T: Separator, default tab-k: which interval to order an example: CAT/ETC/PASSWD | Sort (default to first sort, and literal type) passwd: Split, sorted by third field, and sorted numerically cat/etc/passwd | Sort-t ': '-K 3-n
4.uniq, go heavy uniq [-ic]-I: Ignore case-C: Count
5.WC, Count-l there are how many lines-W have how many characters m
6.tee, double directional, transfer data to file and screen tee [-a] file-a has been added to the file 7.tr, output a paragraph of information in the text, or the replacement of text information tr [-DS] SET1 ...-d: Delete the SET1 this string in the message-s : Replace the duplicate character lowercase to replace uppercase: TR ' [A-z] ' [A-z] '
8.col, often used to convert the man page into plain text for easy lookup-x: Replace the TAB key with an equivalent SPACEBAR: Man col | Col-x | cat-a | More
9.join, handle the content between two files, add the same row of two files with the same data join [-TI12] file1 file2-t:join default to spaces split data and compare the first field-I: Ignore case- 1: Indicates which field the first file is to be processed with-2: Same-1 cases: The/etc/passwd/etc/shadow is integrated according to the first field join-t ': '/etc/passwdd/etc/shadow/etc/ passwd According to the fourth field,/etc/group is consolidated according to the third field join-t ': '-1 4/etc/passwd-2 3/etc/group join requires processed files to be sorted beforehand
File as-represents standard input 10.paste pastes the same line of files together. Middle Tab Separate-D: separator paste [d] file1 file2 file3 ...
11.expend, Convert tab to space expand [-T] File-t: followed by a number that indicates how many spaces the tab will be converted to grep ' ^manpath '/etc/man.config | head-3 | Expand-t 6-| Cat-a Unexpand The Space into tab 12.split, a large file based on file size or number of lines cut into small files split [-bl] file Prefix-b: Back to the size of the file to be cut-l: Cut to the number of lines PREFIX: can be used as cutting Leading text of the file, file name
Example: Split a file into a 300k size, and the split filename starts with termcap split-b 300k/etc/termcap termcap merges files into one file: Cat termcap* >> Termback
Output every 10 lines of ls-al output to a file: Ls-al | Split-l 10-lsroot
13.xargs, generates a command parameter, does not support the pipeline command, can provide the command by Xargs to reference standard input



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.