On Debian (and most Unix-like systems), you can overwrite stdout with stderr by redirecting stderr to stdout. Here are the common ways to do it:
Use 2>&1 to redirect stderr (file descriptor 2) to stdout (file descriptor 1):
bashcommand 2>&1
If you want to discard stdout and only show stderr, use:
bashcommand 2>&1 >/dev/null
2>&1 redirects stderr to stdout.>/dev/null discards stdout (and thus stderr, since it was redirected to stdout).If you want to swap stdout and stderr (so stderr goes to stdout and stdout goes to stderr), use:
bashcommand 3>&2 2>&1 1>&3 | command2
If you want to save stderr to a file and overwrite stdout with it:
bashcommand 2> error.log cat error.log >&1
Vibe can make mistakes. Check answers. Learn more