Killing processes

Each process you start is usually completed within a few seconds. Sometimes a background process or a process without a controlling terminal hangs up and you will need to destroy this process by killing it.

To kill a process use the kill command.

   kill [-signal] process_identifier (PID)

Use the ps command if you need to find the PID of a process.

Always try to kill a process with a simple kill command.

   kill process_identifier

This is the cleanest way to kill a process and has the same effect as cancelling a process.

If this does not work use the -1 (one) signal.

   kill -1 process_identifier

This tells the process to hangup just as though you were logging out. The system will attempt to kill any child processes.

As a last resort use the -9 signal:

   kill -9 process_identifier

This will stop the process dead in its tracks but it may leave any child processes still running.


[Home] [Search] [Index] This site maintained by webmaster@cs.auckland.ac.nz