I have a process on a machine which I stopped (with a Ctrl-Z). After ssh'ing onto the machine, how do I resume the process?
When job control is active you can restart a suspended process. To restart a process with the stop command, you must first determine the JID by using the jobs command. You can then use the JID with the following commands: fg %JID Resume a stopped or background job in foreground.
If you have a suspended job that you'd like to resume running, first you must decide whether you want it running in the foreground, or the background. Find the job ID of the suspended job with the jobs command, and then use bg (to run the job in the background), or fg (to run the job in the foreground).
If you have just hit Ctrl Z , then to bring the job back just run fg with no arguments.
You may be familiar with suspending a process that is running in the foreground by pressing CTRL-Z. It will suspend the process, until you type "fg", and the process will resume again.
You will need to find the PID and then issue kill -CONT <pid>
.
You can find the PID by using ps
with some options to produce extended output. Stopped jobs have a T
in the STAT
(or S
) column.
If you succeed in continuing the process but it no longer has a controlling terminal (and it needs one) then it could possibly hang or go into a loop: just keep your eye on its CPU usage.
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