The question is special because some keys, such as CTRL+Z, stopped working.
I tried to put the process to background by typing in the order:
- find /
- CTRL+Z
- bg
However, I can still see the stdout. The only difference to only doing the first step is that the command CTRL+Z does not work anymore. It is rather nasty when I have unsaved jobs and my harddrive is over 100GB. So
how can I put the process to background?
[Details]
I am using the fourth version of Bash on Mac.
[Crux Reply by Nicholas Riley]
The problem is really that I do not understand the "ramifications" of running process background. I cannot understand why the commnands, such as CTRL+Z, do not work to background processes. I was still able to kill the process in another shell with the command:
ps -ej | awk '! /grep/ && /find/ {print $2}' | xargs kill -9
^Z
isn't working because the frontmost job is now the shell, and shells don't usually respond to SIGTSTP
. (If you do really want to suspend a non-login shell, suspend
usually works.)
The problem seems to be you misunderstand the ramifications of a job being in the background. Redirecting the job's standard output is unrelated.
In fact, it's unclear what you want to do. If you just want to stop find
from running, then fg
it and use ^C
or ^\
(which by default send SIGINT
and SIGQUIT
respectively).
If you want to keep find
running but suppress its further output, then the easiest solution I can think of is to use bg ; disown ; exit
. That will stop the shell from killing its child process (find
) and exit the shell; assuming it's at the top level of the Terminal window, you'll see a bit more output and find
will keep running (but you'll have no way to interact with it).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With