killall

process managementLinux/Unix
The killall command is one of the most frequently used commands in Linux/Unix-like operating systems. killall The killall command terminates processes by name rather than by process ID (PID). It can kill multiple processes with the same name simultaneously, making it more convenient than the kill command when you don't know or don't want to look up process IDs. Like kill, it can send any signal to the specified processes.

Quick Reference

Command Name:

killall

Category:

process management

Platform:

Linux/Unix

Basic Usage:

killall [options] [arguments]

Common Use Cases

  • 1

    Process termination

    Terminate processes by name

  • 2

    Resource management

    Manage system resources by terminating processes

  • 3

    Scripting

    Use in shell scripts to terminate processes programmatically

  • 4

    Troubleshooting

    Resolve issues with unresponsive or misbehaving processes

Syntax

killall [options] name...

Options

Option Description
-e, --exact Require exact match for very long names
-I, --ignore-case Case insensitive process name match
-g, --process-group Kill the process group to which the process belongs
-i, --interactive Ask for confirmation before killing
-l, --list List all known signal names
-o, --older-than TIME Kill processes older than TIME (time units: s=seconds, m=minutes, h=hours, d=days, w=weeks)
-y, --younger-than TIME Kill processes younger than TIME
-q, --quiet Do not print complaints when no processes were killed
-r, --regexp Interpret process name as an extended regular expression
-s, --signal SIGNAL Send this signal instead of SIGTERM
-u, --user USER Kill only processes owned by specified user
-v, --verbose Report if the signal was successfully sent
-w, --wait Wait for all killed processes to die
-V, --version Display version information

Examples

How to Use These Examples

The examples below show common ways to use the killall command. Try them in your terminal to see the results. You can copy any example by clicking on the code block.

#

Basic Usage:

killall firefox

Terminate all processes named "firefox" by sending the default TERM signal.

killall -9 chrome

Force kill all processes named "chrome" by sending the KILL signal (9).

killall -SIGTERM nginx

Send the TERM signal to all processes named "nginx" using the signal name instead of number.

Selective Termination:

killall -u username firefox

Kill only the "firefox" processes owned by the specified user.

killall -g httpd

Kill processes in the same process group as "httpd".

killall -v nginx

Verbose mode: report if the signal was successfully sent.

Signal Types:

killall -l

List all available signal names that can be used with killall.

killall -HUP sshd

Send the HUP (hangup) signal to all "sshd" processes, typically used to make them reload configuration.

killall -STOP firefox

Pause all "firefox" processes (they can be resumed later with CONT signal).

killall -CONT firefox

Resume all "firefox" processes that were previously stopped.

Advanced Usage:

killall -i java

Interactive mode: ask for confirmation before killing each process.

killall -w firefox

Wait for all "firefox" processes to die.

killall -o 15m firefox

Kill only "firefox" processes older than 15 minutes.

killall -y 10m firefox

Kill only "firefox" processes younger than 10 minutes.

Try It Yourself

Practice makes perfect! The best way to learn is by trying these examples on your own system with real files.

Understanding Syntax

Pay attention to the syntax coloring: commands, options, and file paths are highlighted differently.

Notes

Common Signals:

  • 1 (HUP): Hangup - Often used to reload configuration
  • 2 (INT): Interrupt - Same as pressing Ctrl+C
  • 9 (KILL): Kill - Forceful termination, cannot be caught or ignored
  • 15 (TERM): Terminate - Default signal, graceful termination
  • 18 (CONT): Continue - Resume a stopped process
  • 19 (STOP): Stop - Pause process, cannot be caught or ignored

Differences from kill Command:

  • killall terminates processes by name, while kill uses process IDs (PIDs)
  • killall can terminate multiple processes with a single command
  • killall supports additional filters like user, process age, and regex matching
  • killall can wait for processes to terminate
  • killall has interactive mode for confirming each termination

Process Name Matching:

  • By default, killall matches process names as displayed by the ps command
  • Use -e (--exact) for exact matching of very long names
  • Use -I (--ignore-case) for case-insensitive matching
  • Use -r (--regexp) to interpret names as regular expressions
  • The process name is typically the command without path information

Filtering Options:

  • -u (--user) limits termination to processes owned by a specific user
  • -o (--older-than) kills only processes running longer than specified time
  • -y (--younger-than) kills only processes running shorter than specified time
  • -g (--process-group) kills the entire process group

Safety Features:

  • -i (--interactive) mode asks for confirmation before each termination
  • -v (--verbose) reports if signals were successfully sent
  • -w (--wait) ensures processes are actually terminated
  • killall has built-in protections against killing system processes

Time Specification:

  • Time units for -o and -y options: s (seconds), m (minutes), h (hours), d (days), w (weeks)
  • Examples: 10m (10 minutes), 2h (2 hours), 1d (1 day)
  • This allows selective termination based on process age

Permissions:

  • Users can only terminate their own processes unless they have root privileges
  • Use sudo to terminate processes owned by other users
  • Some system processes are protected from being killed even by root

Common Use Cases:

  • Quickly terminating all instances of a misbehaving application
  • Reloading configuration of all instances of a daemon (using SIGHUP)
  • Cleaning up processes left behind by a specific application
  • Stopping all processes owned by a specific user
  • Terminating processes based on how long they've been running

System Compatibility:

  • killall behavior can vary between different Unix/Linux distributions
  • On some older Unix systems, killall might kill ALL processes (use with extreme caution)
  • On some systems, killall might not support all options documented here
  • Always check the man page for your specific system

Troubleshooting:

  • If killall reports "no process found" but you're sure the process exists, check for name variations
  • Use ps aux | grep process_name to verify the exact process name
  • For processes with unusual names, try using the -r option with a regular expression
  • If a process doesn't terminate with SIGTERM, try SIGKILL (killall -9) as a last resort

Related Commands:

  • kill - Send signals to processes by PID
  • pkill - Send signals to processes based on name and other attributes
  • pgrep - List processes based on name and other attributes
  • ps - Display information about active processes
  • top - Display and manage process activity
  • htop - Interactive process viewer
  • xkill - Kill a process by clicking on its X11 window

Tips & Tricks

1

Use the -i option to prompt before sending signals

2

Use the -q option to quietly kill processes

3

Use the -r option to kill processes recursively

4

Use the -s signal option to specify the signal to send

5

Use the -v option to display verbose output

Common Use Cases

Process termination

Terminate processes by name

Resource management

Manage system resources by terminating processes

Scripting

Use in shell scripts to terminate processes programmatically

Troubleshooting

Resolve issues with unresponsive or misbehaving processes

Security

Prevent unauthorized access to system resources

Related Commands

These commands are frequently used alongside killall or serve similar purposes:

Use Cases

1

Process termination

Terminate processes by name

2

Resource management

Manage system resources by terminating processes

3

Scripting

Use in shell scripts to terminate processes programmatically

4

Troubleshooting

Resolve issues with unresponsive or misbehaving processes

5

Security

Prevent unauthorized access to system resources

Learn By Doing

The best way to learn Linux commands is by practicing. Try out these examples in your terminal to build muscle memory and understand how the killall command works in different scenarios.

$ killall
View All Commands