Linux notes data stream redirection-Linux general technology-Linux programming and kernel information. The following is a detailed description. Data Stream redirection means that the command output is directly input to other devices, such as files, printers, or garbage bins, instead of printing on the screen.
> Indicates that the redirection output is like ls/tmp/man. config>/tmp/out.txt ls results should have been output on the screen, but> information is used to output to the out.txt file. If the out.txt file does not exist, it will be automatically created.
>>And> the same meaning, but if you use >> if out.txt already exists, add the content output to out.txt.
2> only output error information. If the executed command has both error information and correct output, you can use 2> re-import to other files.
For example, find-name/home/test>/tmp/out.txt 2>/tmp/error.txt output the correct information to/tmp/out.txt output to error.txt
<It indicates the meaning of importing from a file to another file. For example, cat> text.txt will be automatically imported to text.txt after you press ctrl1_d. If cat> text.txt <somtext.txt is imported to test.txt
<Eof indicates that the input ends. It can replace CTRL + d, for example, cat> text.txt <
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