killall Command

Purpose

Cancels all processes except the calling process.

Syntax

killall [ - ] [ -Signal ]

Description

The killall command cancels all processes that you started, except those producing the killall process. This command provides a convenient means of canceling all processes created by the shell that you control. When started by a root user, the killall command cancels all cancellable processes except those processes that started it. If several Signals are specified, only the last one is effective.

If no signal is specified, the killall command sends a SIGKILL signal.

Flags

Item Description
- Sends a SIGTERM signal initially and then sends a SIGKILL signal to all processes that survive for 30 seconds after receipt of the signal first sent. This gives processes that catch the SIGTERM signal an opportunity to clean up. If both - and -Signal are set, the killall command sends the specified signal initially and then sends a SIGKILL signal to all processes that survive for 30 seconds after receipt of the signal first sent.
-Signal Sends the specified Signal number or SignalName.

Security

Attention RBAC users and Trusted AIX users: This command can perform privileged operations. Only privileged users can run privileged operations. For more information about authorizations and privileges, see Privileged Command Database in AIX® Version 7.1 Security. For a list of privileges and the authorizations associated with this command, see the lssecattr command or the getcmdattr subcommand.

Examples

  1. To stop all background processes that have started, enter:
    killall
    This sends all background processes the kill signal 9 (also called the SIGKILL signal).
  2. To stop all background processes, giving them a chance to clean up, enter:
    killall -
    This sends signal 15, the SIGTERM signal; waits 30 seconds, and then sends signal 9, the SIGKILL signal.
  3. To send a specific signal to the background processes, enter:
    killall -2
    This sends signal 2, the SIGINT signal, to the background processes.