fbpx

Programs or individual processes can no longer be terminated under certain circumstances, for example, crashes. On Linux, however, the kill family offers a last resort for killing processes. This avoids a system restart.
Solution: If you have identified a process that can no longer be terminated in the normal way, then you must force it to be terminated. The command for this is kill quite vividly. In principle the syntax is quite simple: kill or kill -9 . The latter cannot be blocked. That means the process will be mercilessly shot down. You can also send several processes into data nirvana at the same time: kill .

man page for kill command

Table of Contents

Using kill

To kill a single process, let’s extract the process ID and kill it with one command.

Sending the process into Oblivion

Using pkill

If the process has spawned multiple subprocesses or threads, we can pkill to kill them all.

Using pkill to nuke everything

The pkill command works similarly, but only closes all child processes and leaves the parent process alive. You can also provide this with switch -9. For example, pkill -9 httpd closes all child processes of the webserver. With wkillall , both the parent and the child processes are at stake. See the appropriate man pages for more information: man kill, man pkill, and man killall .

Products: The kill , pkill and killall commands are part of the Linux / UNIX inventory. (cvi)


0 Comments

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.