How do you kill a process in Terminal on a Mac?
Last reviewed: 19 November 2026.
Find the process's PID with pgrep -l and a name, then run kill followed by the PID. That sends the TERM signal, which asks the process to quit cleanly; if it ignores it, kill -9 followed by the PID sends KILL, which cannot be ignored. Processes owned by root or another user need sudo in front.
What are the steps to kill a process?
- Find the PID. Run
pgrep -l Preview, replacing Preview with part of the process name. Note the number at the start of the line. - Ask it to quit. Run
kill 1234with that PID. This sends TERM (signal 15), the default. - Check that it exited. Run
pgrep -l Previewagain. No output means the process is gone. - Force it only if needed. If it is still running after a few seconds, run
kill -9 1234. KILL (signal 9) ends the process immediately; unsaved work in it is lost. - Use sudo for system processes. For a process owned by root or another user, run
sudo kill 1234and enter your administrator password. The kill man page notes that only the super-user may signal other users' processes.
What is the difference between kill, killall and pkill?
| Command | Selects processes by | Example |
|---|---|---|
kill | PID | kill 1234 |
killall | Exact process name | killall Preview |
pkill | Part of the name, or the full command line with -f | pkill -f "Helper (Renderer)" |
killall and pkill signal every matching process, so check the match first with pgrep -l using the same pattern. A pattern that is too short can match more than you meant.
Which signals matter?
- TERM (15): the default. The process can save state and exit. Most apps treat it like Quit.
- INT (2): what Control-C sends to a program running in the Terminal window.
- HUP (1): some background services reload their settings when they get it.
- KILL (9): ends the process at once. It cannot be caught or ignored, so the process gets no chance to save.
Run kill -l to list every signal name.
What if the process comes straight back?
Many macOS processes are launchd jobs that launchd restarts when they exit, such as the Dock, Finder and most system daemons. Killing them only helps if the new copy behaves better. To stop a third-party background job from starting at all, remove it in System Settings > General > Login Items & Extensions. See how to see launch agents and daemons.
Do not kill kernel_task, launchd, WindowServer or loginwindow. Killing WindowServer or loginwindow logs you out and closes every app without saving.
How can Thrum help?
Thrum keeps a live CPU graph in the menu bar. One click shows the eight processes using the most CPU. An optional alert tells you when a process stays above a CPU level you choose (50 to 200% of one core) for 1 to 10 minutes.
Thrum is $4.99 once with a 14-day free trial and no account. It requires macOS 26 Tahoe on Apple silicon or Intel.
Questions
Is kill -9 bad?
It is safe for the Mac but not for the app's data: the process cannot save or clean up. Use plain kill first and keep -9 for processes that do not respond.
Why does kill say Operation not permitted?
The process belongs to root or another user. Run the command again with sudo in front.
Is there a graphical way to send a signal?
Yes. In Activity Monitor, select the process and choose View > Send Signal to Process, pick a signal and click Send.
Sources
- kill(1), killall(1) and pkill(1) man pages: run man kill, man killall and man pkill in Terminal
- Activity Monitor User Guide: Quit a process