0 - stdin 1 - stdout 2 - stderr /dev/null - discards all data written to it {cmd; cmd; cmd} [any operator] foo.txt - chain multiple commands output to file cmd > foo.txt - stdout to file (overwrite) cmd 2> foo.txt - stderr to file (overwrite) cmd >> foo.txt - stdout to file (append) cmd &> foo.txt - stdout and stderr to file (overwrite) cmd &>> foo.txt - stdout and stderr to file (overwrite) cmd > foo.txt 2>&1 - stdout and stderr to file (overwrite) cmd < foo.txt - file contents to stdin cmd <> foo.txt - open file for both reading and writing cmd1 | cmd2 - stdout from cmd1 to stdin of cmd2 cmd1 |& cmd2 - stdout and stderr from cmd1 to stdin of cmd2