DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
Programming with the UNIX system shell

Terminating active processes

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 PID
or
   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 process

To 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:

[JID] Stopped(user) job_name

See the kill (1) manual page for all available options and an explanation of the capabilities of each.


Next topic: Restarting a stopped process
Previous topic: Obtaining the status of running processes

© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 27 April 2004