process
kill
Sends a signal to one or more processes. Defaults to SIGTERM, allowing a process to clean up before exiting.
kill [-SIGNAL] PID... Common flags
| Flag | Purpose |
|---|---|
| -l | List available signal names and numbers |
| -s | Send a specific signal by name (e.g. -s TERM) |
| -9 | Send SIGKILL -- cannot be caught or ignored |
| -15 | Send SIGTERM -- the polite default |
| -HUP | Send SIGHUP -- often used to reload configs |
Examples
kill 4321 Ask PID 4321 to terminate gracefully
kill -9 4321 Force-kill a stuck process
kill -HUP $(pidof nginx) Signal nginx to reload its configuration
kill -l List signal names available on this system
Gotcha
SIGKILL leaves no chance for cleanup -- try SIGTERM first, then SIGKILL only if the process refuses to exit.
Related commands
ps
Snapshots the current process list. Accepts both BSD-style and UNIX-style flags depending on how you want to slice the output.
top
Interactive real-time view of processes and system resource usage. Refreshes on an interval and supports live sorting and filtering.
chmod
Changes file mode (permission bits). Accepts symbolic modes like u+x or octal modes like 755.