Consider a program hello_and_error
that writes to both stdout and to stderr. To redirect both to stdout:
hello_and_error 2>&1
If you want to redirect both to the same file hello.txt
you can do in bash the following:
hello_and_error &> hello.txt
If you …