0

Is there a way to redirect stderr to stdout, so that all stderr output is received in stdout, but without also redirecting to a file?

There are of course a number of ways of redirecting stderr to stdout and then outputting the combined stream to a file, but in this case I want all of the output to just come through stdout without any files being involved.

Bri Bri
  • 2,169
  • 3
  • 19
  • 44

1 Answers1

2

As I understand, you want to redirect stderr to stdout and print stdout to terminal?

If, so:

command 2>&1

where:

0 = stdin
1 = stdout
2 = stderr

2>&1 means: redirect stderr into stdout

you can also do:

2>filename

  • I tried that and got an error about a missing file, but tried it again and it worked. Must've typed the wrong character or something! – Bri Bri Oct 05 '22 at 13:08