How to deal with output from a background linux task How to deal with output from a background linux task bash bash

How to deal with output from a background linux task


you could have the process write its output to a file (if you need to view it later) like this:

git clone https://github.com/mrdoob/three.js.git >output.txt &

or discard the output altogether like this:

git clone https://github.com/mrdoob/three.js.git >/dev/null &

edit:

you could also include any error messages sent to stderror in either of the above options by replacing the & with 2>&1 &


The other answers are good, but you can also use:

git clone -q ...

See here for details.


redirect its standard output:

git clone https://github.com/mrdoob/three.js.git > /dev/null &

or use appropriate verbose options of the command (in this case git)