kill
Processes and system
Usage
kill [-SIGNAL] <pid>Sends a signal to a PID to shut a process down; the default TERM lets it clean up, while `-9` cannot be caught, so open files and lock files are left behind.
Common flags
| Flag | Meaning |
|---|---|
| -15 / -TERM | The default: ask the process to shut down so it can clean up. |
| -9 / -KILL | Cannot be caught or ignored. The process dies immediately with no cleanup. |
| -1 / -HUP | Traditionally means "reload your configuration" for daemons. |
| -0 | Send nothing; just test whether the PID exists and you may signal it. |
| -l | List the signal names and numbers on this system. |
Examples
kill 1234Politely ask PID 1234 to exit.
kill -9 1234Force it out after the polite attempt did nothing.
kill -HUP $(pgrep -o nginx)Tell the nginx master process to reload its config.
What is running and what is eating the machine. Identifying it comes before killing it.
How to read this
- Square brackets [ ] mark a part you may leave out.
- An ellipsis … means you can list more than one.
- Flags are case-sensitive — in some commands -r and -R do different things.
Questions
Q. What does kill do?
Sends a signal to a PID to shut a process down; the default TERM lets it clean up, while `-9` cannot be caught, so open files and lock files are left behind.
Q. How do I type it?
kill [-SIGNAL] <pid> — square brackets mark the parts you can leave out.
Q. How many flags are worth knowing?
5 are listed here; the full set is in man kill. This command sits under Processes and system.
Related commands
man page: man kill