1> FILE redirect standard output (stdout) of a command to FILE Example (the output of the command will be placed in the file, FILES; any error messages will appear on the screen): Code: ls [a-z]* 1> FILES 2> FILE redirect standard error (stderr) of a command to FILE Example (the output of the command will appear on the screen; any error messages will be placed in the file, ERRORLOG): Code: ls qwerty asdfg 2> ERRORLOG CMD <<EOF Use the following lines (known as a here document) as input to CMD. The here document ends with the second EOF on a line by itself. Example (the lines between EOF and EOF command will appear on the screen): Code: cat <<EOF This a test of a here document EOF
Example (the output of the command will be placed in the file, FILES; any error messages will appear on the screen): Code: ls [a-z]* 1> FILES
ls [a-z]* 1> FILES
Example (the output of the command will appear on the screen; any error messages will be placed in the file, ERRORLOG): Code: ls qwerty asdfg 2> ERRORLOG
ls qwerty asdfg 2> ERRORLOG
Example (the lines between EOF and EOF command will appear on the screen): Code: cat <<EOF This a test of a here document EOF
cat <<EOF This a test of a here document EOF