MCQ: stdout stderr and redirects

Feb 13, 2014 • Gabriel Devenyi

MCQ: To redirect all text output from a command to a file named filename:

a) command > filename

b) command 2> filename

c) command 2>&1 filename

d) command > filename 2>&1

 

Exercise

I want to redirect stdout to a file

command __ filename ___

I want to redirect stderr to filename

command __ filename ___

 

Re-evaluation question

To redirect all stdout to a file named filename1 and stderr to a file named filename2 you must:

a) command > filename1 2>&1 > filename2

b) command > filename1 2> filename2

c) command 1> filename1 2> filename2

d) command > filename2 2> filename1