Search code examples
bashio-redirection

Redirect stderr to stdout without also redirecting to a file?


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.


Solution

  • 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