file descriptors
Data Stream for Input
STDIN – 0
Data Stream for Output
STDOUT – 1
Data Stream for Output that relates to an error occurring.
STDERR – 2
find /etc/ -name shadow 2>/dev/nullredirect errors to null
Redirect STDOUT to a File
find /etc/ -name shadow 2>/dev/null > results.txtRedirect STDOUT and STDERR to Separate Files
find /etc/ -name shadow 2> stderr.txt 1> stdout.txtRedirect STDIN
cat < stdout.txtRedirect STDOUT and Append to a File
find /etc/ -name passwd >> stdout.txt 2>/dev/nullRedirect STDIN Stream to a File
cat << EOF > stream.txt End-Of-File (EOF) function of a Linux system file, which defines the input's end.
Pipes
to use the STDOUT from one program to be processed by another.
find /etc/ -name *.conf 2>/dev/null | grep systemdfind /etc/ -name *.conf 2>/dev/null | grep systemd | wc -l