Restarting a stopped process
This procedure describes how to restart a process that has been stopped with a Ctrl-Z.
Note: Ctrl-Z works in the Korn shell (ksh) and C shell (csh), but not in the Bourne shell (bsh). To restart a stopped process, you must either be the user who started the process or have root user authority.
- To show all the processes running or stopped but not those killed
on your system, type the following:
ps -efYou might want to pipe this command through a grep command to restrict the list to those processes most likely to be the one you want to restart. For example, if you want to restart a vi session, you could type the following:
This command would display only those lines from the ps command output that contained the word
ps -ef | grep vi
vi. The output would look something like this:
UID PID PPID C STIME TTY TIME COMMAND root 1234 13682 0 00:59:53 - 0:01 vi test root 14277 13682 1 01:00:34 - 0:00 grep vi
- In the ps command output, find the process you
want to restart and note its PID number. In the example, the PID is
- To send the CONTINUE signal to the stopped process, type the following:
kill -19 1234Substitute the PID of your process for the
-19indicates the CONTINUE signal. This command restarts the process in the background. If the process can run in the background, you are finished with the procedure. If the process must run in the foreground (as a vi session would), you must proceed with the next step.
- To bring the process in to the foreground, type the following:
fg 1234Once again, substitute the PID of your process for the
1234. Your process should now be running in the foreground. (You are now in your vi edit session).