How to not show the stdout output of a running process

processstdout

When a running process gives lots of stdout output throughout its lengthy running process, you don't want to kill it and rerun it. How can you not show the output? Thanks.

Best Answer

One approach could be to attach a debugger to the process and make it open stdout on /dev/null:

gdb --batch -ex 'call close(1)' -ex 'call open("/dev/null",2)' -p "$pid"
Related Question