What is the meaning of “2>&1” in a Unix shell?

In Unix shell file descriptor 1 is for standard output.
File description 2 is for standard error.

We can use “2>&1” in a command so that all the errors from standard error go to standard output.

% cat file 2>&1

Read the full book at www.amazon.com
Posted in Unix, Unix Interview Questions

Leave a Reply

Your email address will not be published. Required fields are marked *

*