Redirect Error Output To File in Linux
In Bash shell or other advance shell there are three file descriptors and these are:
- stdin (0)
- stdout (1)
- stderr (2)
Redirect all error to file
# command 2> stderr.txt
Redirect output & errors to different files
# tecdistro > stdout.txt 2> stderr.txt
Redirect output and errors to same file
# tecdistro > allout.txt 2>&1