Linux command list

kill command: stop a running process

__ __ _ _____
\ \ / /__| |_|_ _|__ _ __ _ __ ___
\ \ /\ / / _ \ '_ \| |/ _ \ '__| '_ ` _ \
\ V V / __/ |_) | | __/ | | | | | |
\_/\_/ \___|_.__/|_|\___|_| |_| |_| |_
 
A sandbox for trying kill. Nothing here can touch your real files.
user@webterm:~/project$
 

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

Syntax

kill [signal] PID...

It sends a signal to the process with that PID.

Try it first

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

kill is a request

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.

The signals

-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 itNameMeaning
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.

When you actually reach for it

kill is what you type for a process you can no longer reach from a screen.

SituationWhat to type
Stop a runaway processps aux | grep <name> for the PID, then kill <PID>
It ignored thatkill -9 <PID>
Make a daemon reread its configkill -HUP <PID>
Stop something running as another usersudo 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.

Things that trip people up

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.

Practise it hands-on

webterm.appthis site

  • Advanced Terminal Commands

    Learn commands for specific situations

    Try the tutorial

learn.webterm.appa separate site

>_WEBTERM LEARN

WebTerm Learn: from one command to actually using it

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 course

Related commands

ps / top / jobs

Frequently asked questions

Does kill force a process to stop?
Not by default. It sends SIGTERM, which is a **request** to shut down cleanly. The forceful one is `kill -9`, SIGKILL.
How do I find the PID?
`ps aux | grep <name>`. The second column of the matching line is the PID, and that is what you hand to kill.
Why not go straight to -9?
Try plain `kill` first. SIGKILL gives the process no chance to clean up, so half-written files and stale locks can be left behind. It is the last resort, not the first.
I get Operation not permitted.
You cannot signal someone else's process. Check the USER column in `ps aux`, and use `sudo kill <PID>` if the process really is not yours.
Are -9 and -SIGKILL the same?
Yes. Numbers and names both work, so `kill -9`, `kill -KILL` and `kill -SIGKILL` all mean the same thing.