How to Kill a Process in Linux
Find a process, send it SIGTERM first, and use SIGKILL only when necessary.
The safest process termination workflow is identify, inspect, then signal. SIGTERM is the normal first choice because it allows an application to clean up.
Step by step
1 Find the process
$ ps aux | grep node Use a distinctive process name and verify the PID before acting.
2 Inspect the PID
$ ps -fp 12345 Confirm the PID and full command line.
3 Ask it to exit cleanly
$ kill 12345 SIGTERM asks the process to shut down gracefully.
4 Force termination as a last resort
$ kill -9 12345 SIGKILL cannot be caught or handled by the process, so normal cleanup is skipped.
Tips worth knowing
- For system services, prefer `systemctl stop SERVICE`.
- Inspect parent/child relationships when needed.
- Re-check the PID immediately before destructive signals.
Frequently asked questions
What does kill do in Linux?
It sends a signal to a process identified by PID; the default is SIGTERM.
What does kill -9 do?
It sends SIGKILL, which the target cannot catch or ignore.
The commands behind it
Terminate processes politely or forcibly — and understand what -9 really does.
psSee what is running, find a process ID, and combine with grep to hunt down a program.
top & htopThe live dashboard: CPU, memory, load average and the processes consuming them.
Concepts involved: Process · PID (Process ID)
More how-to guides
See how much space is left, and find out what is using it.
Extract a .tar.gz archiveUnpack tar.gz, tar.bz2, tar.xz and zip archives from the command line.
Free a port that is already in useFind which process holds a port and stop it cleanly.
Find and replace text in filesReplace text in one file or across a whole project, safely.