The Linux command killall ter­mi­nates processes that no longer function properly and thus prevents a restart. To prevent errors, the command can be cus­tomized.

What is Linux killall?

In certain cir­cum­stances, even under a Linux en­vi­ron­ment, the system can become over­whelmed, causing in­di­vid­ual programs or processes to mal­func­tion or operate im­prop­er­ly. To cir­cum­vent the need for a complete system reboot in such sit­u­a­tions, the killall command proves to be in­valu­able across most Linux dis­tri­b­u­tions, such as Debian or Ubuntu. Despite its for­mi­da­ble moniker, the command serves a crucial purpose. It forcibly ter­mi­nates all processes, excluding itself, thereby al­le­vi­at­ing strain on your computer and con­serv­ing memory resources.

How does the Linux killall command work?

Linux killall is an emergency option when one or more processes become un­re­spon­sive or exhibit bad behavior, rendering them unable to be ter­mi­nat­ed through standard means. It operates by issuing a signal to all active processes that match the commands specified within the killall command. The processes to be targeted can be iden­ti­fied using either their names or cor­re­spond­ing numerical iden­ti­fiers.

What’s the syntax of the killall command?

The syntax of Linux killall looks as follows:

$ killall [Options] [Name]
bash

Precise spelling and case sen­si­tiv­i­ty are vital when spec­i­fy­ing the process name with the killall command. In the absence of a specific process name, executing the killall command will terminate all back­ground processes except for killall itself.

Which options are available with killall?

There are numerous options for Linux killall. The most important ones are:

  • -e or –exact: With this option you ensure that the exact spelling is taken into account even for long names. Otherwise only the first 15 char­ac­ters of the command may be con­sid­ered.
  • -g or –process-group: With this option you terminate the entire process group to which a process belongs.
  • -I or –ignore-case: This option ignores the upper and lower case.
  • -i or –in­ter­ac­tive: Before ter­mi­nat­ing a process, this option in­ter­ac­tive­ly enquires about it.
  • -l or –list: The option spits out a list of all known signals.
  • -q or –quiet: With this option, you won’t receive a complaint if no process was ter­mi­nat­ed by the killall command.
  • -V or –version: With this option you get the version number.
  • -v or –verbose: Through this option you’ll receive a no­ti­fi­ca­tion if a process has been suc­cess­ful­ly completed.
  • -w or –wait: With this option the Linux killall checks every second if all processes have been ter­mi­nat­ed.

Examples of the Linux killall command

Finally, here are a few examples of Linux killall:

$ killall
bash

This command stops all back­ground processes im­me­di­ate­ly.

$ killall Example
bash

This command ter­mi­nates the process “Example”.

$ killall -i Example
bash

The system asks for con­fir­ma­tion before ending the “Example” process.

Go to Main Menu