The Linux command killall ter­min­ates processes that no longer function properly and thus prevents a restart. To prevent errors, the command can be cus­tom­ised.

What is Linux killall?

In certain cir­cum­stances, even under a Linux en­vir­on­ment, the system can become over­whelmed, causing in­di­vidu­al programs or processes to mal­func­tion or operate im­prop­erly. To cir­cum­vent the need for a complete system reboot in such situ­ations, the killall command proves to be in­valu­able across most Linux dis­tri­bu­tions, such as Debian or Ubuntu. Despite its for­mid­able moniker, the command serves a crucial purpose. It forcibly ter­min­ates all processes, excluding itself, thereby al­le­vi­at­ing strain on your computer and con­serving memory resources.

How does the Linux killall command work?

Linux killall is an emergency option when one or more processes become un­re­spons­ive or exhibit bad behaviour, rendering them unable to be ter­min­ated 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­res­pond­ing numerical iden­ti­fi­ers.

What’s the syntax of the killall command?

The syntax of Linux killall looks as follows:

$ killall [Options] [Name]
bash

Precise spelling and case sens­it­iv­ity are vital when spe­cify­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­sidered.
  • -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­act­ive: Before ter­min­at­ing a process, this option in­ter­act­ively 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­min­ated 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­fic­a­tion if a process has been suc­cess­fully completed.
  • -w or –wait: With this option the Linux killall checks every second if all processes have been ter­min­ated.

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­ately.

$ killall Example
bash

This command ter­min­ates the process ‘Example’.

$ killall -i Example
bash

The system asks for con­firm­a­tion before ending the ‘Example’ process.

Go to Main Menu