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

Leave a Reply

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