"1>” "2>" "2>&1"

1 is standard output
2 is error output
> and >> are output redirection symbols. Standard output is printed to the console by default. If you want to import to a file, you need to use > or >>. > will overwrite the existing file content, and >> will append to the existing content.
< and << are input redirection symbols. Read content from a file.
2>&1 is to import (merge) the error output into the standard output stream

grep "standard"* > grep.out 2>&1 is to send the standard output and error output together into the grep.out search file, the way to write the file is Overwrite (>).
cat >>filetest 2>&1 <<MAYDAY is to read the file content from MAYDAY, and send the standard output and error output to the filetest file together. The way to write the file is additional write (>>).

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326403380&siteId=291194637