← Linux command list

kill command: stop a running process

__ __ _ _____
\ \ / /__| |_|_ _|__ _ __ _ __ ___
\ \ /\ / / _ \ '_ \| |/ _ \ '__| '_ ` _ \
\ V V / __/ |_) | | __/ | | | | | |
\_/\_/ \___|_.__/|_|\___|_| |_| |_| |_
 
A sandbox for trying kill. Nothing here can touch your real files.
 

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-12-05

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    10:30  14:46 python3 backup_sync.py
user       30001  0.0  0.1  12345  2345 pts/0    S+   10:45   0:00 grep --color=auto python3

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 bash
   2345 pts/0    00:00:00 ps
   2847 pts/0    00:01:23 node

It is gone from the list. Send to the same PID again and you are told there is nobody there.

$ kill 3456
-bash: 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 bash
   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
 1) SIGHUP	 2) SIGINT	 3) SIGQUIT	 4) SIGILL	 5) SIGTRAP
 6) SIGABRT	 7) SIGBUS	 8) SIGFPE	 9) SIGKILL	10) SIGUSR1
11) SIGSEGV	12) SIGUSR2	13) SIGPIPE	14) SIGALRM	15) SIGTERM
16) SIGSTKFLT	17) SIGCHLD	18) SIGCONT	19) SIGSTOP	20) SIGTSTP
21) SIGTTIN	22) SIGTTOU	23) SIGURG	24) SIGXCPU	25) SIGXFSZ
26) SIGVTALRM	27) SIGPROF	28) SIGWINCH	29) SIGIO	30) SIGPWR
31) SIGSYS	34) SIGRTMIN	35) SIGRTMIN+1	36) SIGRTMIN+2	37) SIGRTMIN+3
38) SIGRTMIN+4	39) SIGRTMIN+5	40) SIGRTMIN+6	41) SIGRTMIN+7	42) SIGRTMIN+8
43) SIGRTMIN+9	44) SIGRTMIN+10	45) SIGRTMIN+11	46) SIGRTMIN+12	47) SIGRTMIN+13
48) SIGRTMIN+14	49) SIGRTMIN+15	50) SIGRTMAX-14	51) SIGRTMAX-13	52) SIGRTMAX-12
53) SIGRTMAX-11	54) SIGRTMAX-10	55) SIGRTMAX-9	56) SIGRTMAX-8	57) SIGRTMAX-7
58) SIGRTMAX-6	59) SIGRTMAX-5	60) SIGRTMAX-4	61) SIGRTMAX-3	62) SIGRTMAX-2
63) SIGRTMAX-1	64) SIGRTMAX	

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
-bash: 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
-bash: kill: `abc': not a pid or valid job spec

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

  • Advanced Terminal Commands

    Learn commands for specific situations

    Try the tutorial

learn.webterm.app

>_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

kill is also in the “Processes and services” section of the Linux Commands Cheat Sheet.

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.