Linux OS Shell Question:

cmd 2>&1 > abc will:
a) Write file2 to file1
b) Write standard output and standard error to abc
c) Write standard error to abc
d) Write standard output to abc & standard error to monitor

Linux Shell Interview Question
Linux Shell Interview Question

Answer:

d) Write standard output to abc & standard error to monitor


Previous QuestionNext Question
cmd > abc 2>&1 will:
a) Write file2 to file1
b) Write standard output and standard error to abc
c) Write standard error to abc
d) Write standard output to abc & standard error to monitor
The following commands gives the output like this:
#cat file1 file2
#cat: file1: No such file or directory
hello
If we execute the command "cat file1 file2 1>2 2>&1" the output would be
a) cat: file1: No such file or directory hello
b) No output is displayed
c) Cat: 1>2: No such file or directory
d) hello