Originally Posted by ashley75
From time to time I see the syntax below and I wonder what exactly it's doing?
"2>&1 &" at the end of the command.
This has been a common question.
- 1 represents standard out (stdout) and 2 represents standard error (stderr).
- 2>&1 combines the output of 2 to 1 and vice versa.
- The trailing "&" backgrounds it
So, a common usage would be for cron jobs, to redirect errors/outputs of running scripts. The trailing "&" in that case would start a new background process for that script.