|
|
The kill command terminates active shell processes in background mode and the stop command temporarily suspends the process if job control is active. The general format for these commands is:
kill PIDor
stop %JID
Note that you cannot terminate background processes by pressing the <BREAK> or <DELETE> key. The following example shows how you can terminate the grep command that you started executing in background mode in the previous example.
$ kill 28223 [JID] + Terminated job_name $
Notice that the system responds with a message and a ``$'' prompt, showing that the process has been killed. If the system cannot find the PID number you specify, it responds with an error message:
kill:28223:No such processTo suspend a foreground process in the job shell (only when job control is active), type:
<CTRL-z>A message appears on the screen resembling the following:
See the kill (C) manual page for all available options and an explanation of the capabilities of each.