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
^Zisn’t working because the frontmost job is now the shell, and shells don’t usually respond toSIGTSTP. (If you do really want to suspend a non-login shell,suspendusually 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
findfrom running, thenfgit and use^Cor^\(which by default sendSIGINTandSIGQUITrespectively).If you want to keep
findrunning but suppress its further output, then the easiest solution I can think of is to usebg ; 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 andfindwill keep running (but you’ll have no way to interact with it).