# Killing Processes — Linux

Source: https://www.geekswithgeeks.com/en/linux/linux-killing-processes

> Stopping a process by PID or name.

## kill by PID

`kill PID` sends a termination signal, asking the process to shut down gracefully.

```bash
ps aux | grep nginx
kill 842
```

## kill -9 — force it

`kill -9 PID` (SIGKILL) forcibly terminates a stuck process with no cleanup — use it only when a plain `kill` doesn't work.

```bash
kill -9 842
```

## killall & pkill

`killall nginx` kills every process named `nginx`. `pkill -f pattern` matches against the full command line.
