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