kill asks a running process to stop. Learn how to find the PID, when `-9` is the right answer and why it usually is not, and what the signals mean, by running the commands in a real terminal in your browser.
Updated: 2026-09-06
kill [signal] PID...
It sends a signal to the process with that PID.
Start by finding the PID with ps.
$ ps aux | grep python3
user 3456 98.5 4.2 456789 87654 pts/0 R 09:15 154:56 python3 backup_sync.py
backup_sync.py is burning 98.5 percent of the CPU.
The second column, 3456, is its PID.
$ kill 3456
Success is silent.
Confirm with ps.
$ ps
PID TTY TIME CMD
1234 pts/0 00:00:00 zsh
2847 pts/0 00:01:23 node
2345 pts/0 00:00:00 ps
It is gone from the list. Send to the same PID again and you are told there is nobody there.
$ kill 3456
kill: (3456) - No such process
Despite the name, the default signal is SIGTERM, number 15. It means "wrap up and exit", and the process gets the chance to save what it was writing and close its connections first.
Only when that is ignored do you reach for -9, SIGKILL.
$ kill -9 2847
$ ps
PID TTY TIME CMD
1234 pts/0 00:00:00 zsh
2345 pts/0 00:00:00 ps
SIGKILL is never delivered to the process; it is simply stopped.
With no chance to clean up, it can leave a half-written file or a stale lock behind.
Plain kill first, -9 only if that fails.
-l lists what you can send.
$ kill -l
HUP INT QUIT ILL TRAP ABRT BUS FPE KILL USR1 SEGV USR2 PIPE ALRM TERM STKFLT CHLD CONT STOP TSTP TTIN TTOU URG XCPU XFSZ VTALRM PROF WINCH IO PWR SYS
Three of them cover almost everything you will do.
| How you write it | Name | Meaning |
|---|---|---|
kill <PID> | SIGTERM (15) | Please shut down |
kill -9 <PID> | SIGKILL (9) | Stop, no discussion |
kill -HUP <PID> | SIGHUP (1) | Reload your configuration, by long-standing convention |
Numbers and names are interchangeable.
kill -9, kill -KILL and kill -SIGKILL are the same command.
kill is what you type for a process you can no longer reach from a screen.
| Situation | What to type |
|---|---|
| Stop a runaway process | ps aux | grep <name> for the PID, then kill <PID> |
| It ignored that | kill -9 <PID> |
| Make a daemon reread its config | kill -HUP <PID> |
| Stop something running as another user | sudo kill <PID> |
For something running in the terminal in front of you, Ctrl+C is faster.
kill is for what is running in another terminal or in the background, where you cannot send Ctrl+C.
Other people's processes are off limits.
$ kill 1
kill: (1) - Operation not permitted
Check the USER column in ps aux first.
Anything the system owns needs sudo kill <PID>.
PIDs change every time.
Restarting a process gives it a new number.
Look it up with ps and kill it right away, as one move.
Only numbers are accepted.
$ kill abc
kill: 'abc': invalid process id
kill takes PIDs and nothing else.
Turning a name into a number is what ps is for, which is why the two go together.
webterm.appthis site
Advanced Terminal Commands
Learn commands for specific situations
learn.webterm.appa separate site

Commands stick when they show up in a real sequence of work, not one at a time. There is a course that builds them up in order.
See the courseps / top / jobs