Linux input and output redirection, and piping

Source: Internet
Author: User

Input and output redirection 1, input and output redirection, is for the filter, not for, editor and interactive tool 2,> only the correct standard output redirection, output error message, you can use 2> 3, new or empty files can be used directly with >filename,> and 2> Will clear the target file 4,&> number can redirect the correct information and error message output 6 5,>> can append the redirect to the target file 6,< for input redirection,<< to wait for the input direct target to appear, Enter redirection to redirect standard input to a file, such as a cat

Pipe Output 1, pipe ' channel output can be used |, such as LS|WC-L 2, the pipeline output is left to right, you can use multiple pipelines in one line of command, such as: ls/etc/-L |grep ' ^d ' |wc-l 3,tee the line can be copied output to the target file, generally used in the pipeline output

4,tr to replace the life line, you can simply file encryption, using the following: Echo "Aabbccddee" >a.txt tr ' a-x "B-z" B.txt

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.