Difference between revisions of "Redirection"


From Knoppix Documentation Wiki
Jump to: navigation, search
(Added Redirection)
 
m (Reverted edit of Zy0Vnn, changed back to last version by RubA0a)
 
(5 intermediate revisions by 5 users not shown)
Line 1: Line 1:
Redirection
+
[[Redirection]]
  
 
First, you have input / output streams. This is where the keyboard (input) data or display (output) data is (normally) going to/from.
 
First, you have input / output streams. This is where the keyboard (input) data or display (output) data is (normally) going to/from.
Line 6: Line 6:
 
cmd < read file to pipe input in <br>
 
cmd < read file to pipe input in <br>
 
cmd >> append write file <br>
 
cmd >> append write file <br>
cmd 1>log.out 2>&1 # dump stdin and stderr to the output file.
+
cmd 1>log.out 2>
 
+
 
+
stdin: file stream 0<br>
+
stdout: file stream 1<br>
+
stderr: file stream 2<br>
+
 
+
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'''
+

Latest revision as of 23:01, 19 August 2007

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>