About shell input and output redirection

Source: Internet
Author: User
The following is a syntax format for input and output redirection

Two overview Output input redirection
Greater than sign >: Indicates output redirection (overwrites the original file)
Less than <: Input redirect (if you enter something, then it will show what the output is, will not overwrite and append to the original file)
Double greater than sign >>: (indicates output redirection, which appends content to the contents of the original file)

A practical example of a three-output input redirection
1. Output redirection

Description: We can see that using cat to view the contents of the original file is "Reading Anderson", using the output redirection, view the contents of the original file into a "story of small matches." This is sufficient to indicate that the original file can be overwritten with output redirection.
2. Input redirection

Description: We can see that using input redirection, the results show the input content, when using cat to view the original file, its content is a story-telling match. This is enough to indicate that using input redirection does not overwrite and append the contents of the original file.
3. Output Append redirect

Description: We can see that using the Append output redirect, using Cat to view the original content, shows that the "story-telling match is Reading Anderson". This is enough to indicate that using append output redirection increases the content of the original text.

About shell input and output redirection

Related Article

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.