Redirect all output to file and run in background
$ command-to-run arguments > output_file 2>&1 &
>is used to redirect the command’s (command-to-run) output to the output file (output_file) and replace the file’s current content. If you want to append to the file’s current content you can use the
stdoutis currently going”. In our case that is output_file. In other words the
&1reuses the file descriptor that
stdoutis currently using.
&tells our command to run in the background.
We transform challenges into digital experiences
Get in touch to let us know what you’re looking for. Our policy includes 14 days risk-free!Free project consultation