View the Most Wanted LQ Wiki articles.
LinuxQuestions.org > Linux Wiki > Kill

From LQWiki

Jump to: navigation, search

Killing a process means forcing it to quit immediately.

It's always best to quit an application properly, such as selecting Quit from a menu. Ctrl-C or Ctrl-D will usually quit an application in a terminal, and File-Quit or closing the window will do the same in X. Using the command 'kill -TERM pid' (TERM is default, and so not strictly needed) will tell the given process to terminate.

The application can refuse all of these (but it should have a very good reason if it chooses to do so), in which case you can use 'kill -KILL pid' (or -9) to forcefully terminate it. The process will not stand a chance.

However, certain system calls can't be interrupted. If an application is trapped in one of these, the program can't be killed. This happens very rarely, and indicates serious bug or a system malfunction (such as when dealing with uninterruptable NFS shares). The only hope is to wait a while to see if it clears up or reboot.

A process can also be defunct, meaning that its parent has not yet noticed that it's dead. If you encounter such processes, you can wait it out or try killing its parent instead. Such processes are called zombies.

See also


Personal tools