Pages

Wednesday, October 17, 2012

Redirect Standard Error to Standard Output / Redirect Standard Output to Standard Error / Redirect to File

To Redirect Standard Error to Standard Output
command_1 1>&2 | command_2

To Redirect Standard Output to Standard Error

command_1 2>&1 | command_2

To Redirect Standard Output to File
command > filename
OR
command 1> filename


To Redirect Standard Error to File
command 2> filename


To Redirect Standard Output and Standard Error to Separate Files
command 1> filename1 2> filename2

To Redirect Standard Output and Standard Error to Single File

command &> filename

No comments:

Post a Comment