cat brain.log | less

Getting it down on `paper`

STDERR redirect into STDOUT redirect into file

When you want to redirect stderr to a file, you have choices.  Either redirect only stderr to a file, or redirect both stderr and stdout to the same file.

The right way:

Redirect stderr and stdout to [[file]]:

[[command]] > [[file]] 2>&1

Redirect stderr to [[efile]] and stdout to [[file]]:

[[command]] 2> [[efile]] > [[file]]

The wrong way:

Doesn’t do anything useful:

[[command]] 2>&1 > [[file]]



No comments so far.

(comments are closed)