stdin, stdout, stderr
Stream
0stdin1stdout2stderr> /dev/tty- print to screen which cannot be passed directly
Redirect
|pipecommand1 | command2: stdout pipe tocommand2
>pass content to filecommand > file: stdout tofile(1>)command 2> file: stderr2tofilecommand &> file: stderr2+ stdout1tofile(2>&1)command &> /dev/null: suppress all
<pass content from filereadarrary -t array < file
<<heredocvar=$( cat << EOF- set varcat << EOF > file- pass content to file
<<<herestring - pass content to commandcommand2 <<< $( command1 ): multiline stdout tocommand2command <<< "$var": read variable as multiline stdin (here string)
script -c- capture everything on screen to file. (for commands not stdout to var)script -c 'command' file- capture/dev/ttyto file
accummulate stdout
{
command1
command2
command3
} > file