# kill Cheatsheet - Cheatsheets - Launch Pad

__ _______________________ _________._________________________ \_ _____/ \______ \ / _ \ / _____/ / _____/ | | \_ _____/ | __) | _/ / /_\ \ / \ ___ / \ ___ | | | __)_ | \ | | \ / | \ \ \_\ \ \ \_\ \ | |___ | \ \___ / |____|_ / \____|__ / \______ / \______ / |_______ \ /_______ / \/ \/ \/ \/ \/ \/ \/

# kill Cheatsheet

← Back to cheatsheets

← Home

kill sends signals to processes. Terminate, pause, resume, or control processes by PID. Essential for process management and system administration.

## Basic Usage

- kill PID - Send TERM signal (default)

- kill -9 PID - Force kill (SIGKILL)

- kill -15 PID - Terminate gracefully (SIGTERM)

- kill -HUP PID - Hangup signal (reload)

- killall process_name - Kill by name

- pkill pattern - Kill by pattern

## Common Signals

- SIGHUP (1) - Hangup, reload configuration

- SIGINT (2) - Interrupt (Ctrl+C)

- SIGQUIT (3) - Quit with core dump

- SIGTERM (15) - Terminate gracefully

- SIGKILL (9) - Force kill (cannot be caught)

- SIGSTOP (19) - Stop process

- SIGCONT (18) - Continue stopped process

## Signal Syntax

- kill -SIGTERM PID - Signal name

- kill -15 PID - Signal number

- kill -TERM PID - Short name

- kill -l - List all signals

- kill -L - List signals with numbers

## Killing Multiple Processes

- kill PID1 PID2 PID3 - Multiple PIDs

- killall process_name - All processes by name

- pkill -f pattern - Match full command line

- kill -9 $(pgrep process) - Kill by pgrep

## Common Examples

### Terminate Process

    kill 1234

Send TERM signal to PID.

### Force Kill

    kill -9 1234

Force kill unresponsive process.

### Reload Process

    kill -HUP 1234

Send hangup signal (reload config).

### Kill by Name

    killall firefox

Kill all firefox processes.

### Kill by Pattern

    pkill -f "python script.py"

Kill matching processes.

### Stop Process

    kill -STOP 1234

Pause process.

### Continue Process

    kill -CONT 1234

Resume stopped process.

### List Signals

    kill -l

Show all available signals.

### Kill Process Tree

    pkill -P 1234

Kill process and children.

### Kill User Processes

    pkill -u username

Kill all processes for user.

## Tips

- Use SIGTERM first for graceful shutdown

- Use SIGKILL (-9) only when necessary

- SIGKILL cannot be caught or ignored

- Use killall or pkill for convenience

- Check process with ps before killing

- Use -HUP to reload configurations

- Essential for process management

- Be careful with killall on production