Wednesday, March 23, 2011

Input-output redirection

: > filename #zero lenght
> filename #truncate file
>> filename #append stdout to a file
1>filename #redirect stdout to filename
1>>filename #append to filename
2>filename #redirect stderr to filename
2>>filename #append stderr to filename
&>filename #redirect both stdout and stderr to filename

ref: http://tldp.org/LDP/abs/html/io-redirection.html

1 comment: