Here are two ways on who to redirect both standard output and standard error to same file in bash. First the official a recommended way:

printf '%s\n%\n' "Hello bash" > FILE 2>&1

now easier unofficial way:

printf '%s\n%\n' "Hello bash" &> FILE

Free Linux eBooks

Do you have the right skills?

Our IT Skills Watch page reflects an up to date IT skills demand leaning towards the Linux and Unix environment. We have considered a number of skills and operating systems.

See the result...

Go to top