2 replaced http://stackoverflow.com/ with https://stackoverflow.com/
source | link

On this SO threadthis SO thread and a few other threads I have seen the following commands for redirecting stdout and stderr to a file.

Are they all equivalent? Is there any difference between them?

command1 >> logfile 2>&1
command &> logfile
command >& logfile

On this SO thread and a few other threads I have seen the following commands for redirecting stdout and stderr to a file.

Are they all equivalent? Is there any difference between them?

command1 >> logfile 2>&1
command &> logfile
command >& logfile

On this SO thread and a few other threads I have seen the following commands for redirecting stdout and stderr to a file.

Are they all equivalent? Is there any difference between them?

command1 >> logfile 2>&1
command &> logfile
command >& logfile
1
source | link

Redirection differences between &> >& and 2>&1

On this SO thread and a few other threads I have seen the following commands for redirecting stdout and stderr to a file.

Are they all equivalent? Is there any difference between them?

command1 >> logfile 2>&1
command &> logfile
command >& logfile