Redirection


From Knoppix Documentation Wiki
Revision as of 08:12, 19 September 2005 by Dr Kludge (Talk | contribs)

Jump to: navigation, search

Redirection

First, you have input / output streams. This is where the keyboard (input) data or display (output) data is (normally) going to/from.

cmd > write file
cmd < read file to pipe input in
cmd >> append write file
cmd 1>log.out 2>&1 # dump stdin and stderr to the output file.


stdin: file stream 0
stdout: file stream 1
stderr: file stream 2

Advanced:

Teeing error data. So, when you have a large compile running. You can log all output to a file & see what is happening. gcc *.c 1>log1.out 2>log2.out You will not see echoing to the console screen.

gcc *.c 2>&1 | tee all.out