Linux shells use three standard I/O streams, each of which is associated with a well-known file descriptor: stdout is the standard output stream , which displays output from commands. It has file descriptor 1. stderr is the standard error stream , which displays error output from commands. It has file descriptor 2. stdin is the standard input stream , which provides input to commands. It has file descriptor 0. Redirecting output ls x* z* >stdout.txt 2>stderr.txt Standard output in the first file and the errors in the second file. Output redirection using n> usually overwrites existing files. You can control this with the noclobber option of the set builtin. ls x* z* 2>&1 >output.txt This will redirect all errors to standard output and standard output is redirected to the file. The errors will be displayed in the terminal and the output is written to a file. ...
Programming, Machine Learning and Capital Markets