Home > Process Management > killall5

killall5: Send a signal to all processes

killall5 is a command that sends a specified signal to all processes on the system (except for the init process). It is primarily used during system shutdown or reboot and can be very powerful and dangerous, so it should be used with caution.

Overview

killall5 sends a signal to all running processes on the system, excluding the init process. This command is mainly used during system level changes or shutdown procedures. It is a very powerful command, so it should be used with caution, understanding that it can have a severe impact on the system.

Key Features

  • Sends signals to all processes except the init process
  • Primarily used for system shutdown, reboot, and runlevel changes
  • Extremely powerful and can have critical system impact

Key Options

killall5 has a relatively small number of options.

Specify Signal

Exclude Processes

Generated command:

Try combining the commands.

Description:

`killall5` Executes the command.

Combine the above options to virtually execute commands with AI.

Usage Examples

Various usage examples for the killall5 command. This command is very powerful, so caution should be exercised when using it in practice.

Send SIGTERM signal to all processes (default behavior)

sudo killall5

Sends the SIGTERM (15) signal to all processes except the init process, requesting them to terminate. This can be used to initiate a graceful system shutdown.

Forcefully terminate all processes (SIGKILL)

sudo killall5 -9

Sends the SIGKILL (9) signal to forcefully terminate all processes except the init process. This is used as a last resort when processes do not respond to SIGTERM. There is a risk of data loss.

Attempt to terminate all processes, excluding a specific PID

sudo killall5 -o 1234

Sends the SIGTERM signal to all processes, excluding the process with PID 1234. This can be useful when you need to terminate everything else while keeping a specific important process running.

Send SIGHUP signal to all processes

sudo killall5 -1

Sends the SIGHUP (1) signal to all processes except the init process. Some daemons reload their configurations upon receiving SIGHUP.

Installation

killall5 is typically provided as part of the `sysvinit-utils` or `sysvinit-tools` package. It is usually installed by default on most Linux distributions, but if it's not present, you can install it using the following commands.

Debian/Ubuntu based systems

sudo apt update && sudo apt install sysvinit-utils

CentOS/RHEL/Fedora based systems

sudo yum install sysvinit-tools
# Or on newer versions:
sudo dnf install sysvinit-tools

Tips & Warnings

killall5 is a powerful command that affects the entire system, so extreme caution is required when using it.

Extremely Dangerous Command

This command can terminate all user processes on the system, and misuse can lead to system instability or reboot. It should be avoided on servers performing critical tasks.

  • **Risk of Data Loss**: Unsaved data may be lost during a forceful termination.
  • **System Instability**: Essential services may be terminated, causing the system to freeze.

Consider Alternative Commands

If you need to terminate only specific process groups or user processes, it is recommended to use commands that offer finer control, such as `killall` or `pkill`.

  • `killall <process_name>`: Terminate all processes with a specific name
  • `pkill <pattern>`: Terminate processes matching a pattern
  • `kill <pid>`: Terminate a process with a specific PID

Excludes init Process

killall5 does not send signals to the init (or systemd) process with PID 1. This is to protect the core processes of the system.

sudo Usage Required

To send signals to all processes on the system, root privileges are required, so it must be used with `sudo`.


Same category commands