Linux / Unix: killall Command Examples

Linux / Unix: killall Command Examples

The killall command is a Unix and Linux utility that allows you to send a signal to all processes with a specific name.

Here is the basic syntax for using the killall command:

refer ‮:ot‬lautturi.com
killall [-signal] process_name

The -signal option is optional. If you do not specify a signal, killall will send the SIGTERM signal to the processes by default. The process_name argument is the name of the process to kill.

For example, to send the SIGTERM signal to all processes with the name sleep, you can use the following command:

killall sleep

This will send the SIGTERM signal to all processes with the name sleep, which will cause them to terminate.

You can specify a different signal using the -signal option.

For example, to send the SIGKILL signal to all processes with the name sleep, you can use the following command:

killall -SIGKILL sleep

This will send the SIGKILL signal to all processes with the name sleep, which will cause them to terminate immediately.

You can use the -i option to make killall prompt you for confirmation before sending the signal to each process.

For example:

killall -i sleep

This will prompt you for confirmation before sending the signal to each process with the name sleep.

Created Time:2017-10-29 22:09:00  Author:lautturi