So 1 represents stdout and 2 represents stderr. Based upon the information we can:
By default, the command sends outputs to stdout and can be redirected to the file using the following syntax:
command > filename.txt
For example, save the date command output to a file named mydate.txt, run:
date > mydate.txt
To view file contains use the cat command:
cat mydate.txt
We can read input from a file using the following simple syntax and the file must already exist:
command < input.txt
cat < /etc/passwd
wc -l < /etc/passwd
#linux #unix bash #nixcraft