It refers to redirect data flow according to the command output is not printed on the screen, but is directly input to another device such as a printer or a file or hopper
commands command [option] Parameters> | >> | 1> | 2 > | 2 >> File or printing device
> redirect output to indicate there such as ls /tmp/man.config> /tmp/out.txt ls output, but the results should have been used on the screen> output information to know if the file out.txt out. txt file will be automatically created does not exist
>> and> >> but if you use the same meaning if out.txt existing content output to out.txt speaking to accumulate after out.txt
command execution error message if the 2> is the only output both have the correct error message can be output with 2> remapped to other files
, such as find -name / home / test> /tmp/out.txt 2> /tmp/error.txt correct information to the / tmp / out .txt error information is output to the error.txt
<meant to represent files imported from other files, such as cat> text.txt will wait for your input after finished pressing CTRL + d in text.txt automatically imported. If we cat> text.txt <somtext.txt test.txt will be introduced into the right sometext.txt
<< eof indicates the end of input means such as CTRL + d may alternatively cat> text.txt << eof the input data has been input eof to complete.
Note redirect data flow linux
Guess you like
Origin blog.csdn.net/xiebingsuccess/article/details/91857269
Recommended
Ranking