Open Activity Monitor and find the process you want to kill by sorting by resource usage or by process ID. Then click the X button at the top of Activity Monitor and select either “Quit” or “Force Quit” to kill the process.
Is an application or process causing problems on your Mac? Rid yourself of the problem app by killing it using Activity Monitor or the Terminal. You can also find and kill processes that are using specific ports on your Mac.
How to Kill a Mac Process Using Activity Monitor
The easiest way to find and kill a process that’s causing an issue in macOS is to launch Activity Monitor. You can do this using Spotlight (hit Command+Spacebar then start typing “activity” and hit Enter when you see the app) or by finding and launching the app under the Applications > Utilities folder.
Activity Monitor has several views you can use to isolate problems. On the CPU tab, you can see which apps are using the most processing power right now (sort by the “% CPU” tab to see the hungriest processes. You can also use “Memory” to sort by RAM usage, “Energy” to find which apps are using the most power, “Disk” to sort by disk usage, and “Network” to sort by data sent and received.
On top of this, you can use the “Search” box in the top-right corner to search for a process name. You can find the core process and associated processes this way, for example searching for Safari will find the core app, networking processes, individual tabs, extensions, and more.
Find the process you would like to kill and then click on the “X” button in the top-right left corner of the screen. You can then choose between “Quit” and “Force Quit” to attempt to send a quit command (to give the process time to save your data) or a force quit command (to kill the process immediately, ideal if it’s crashed). Find out more about identifying processes that are safe to kill on your Mac.
How to Kill a Mac Process Using Terminal
It’s also possible to kill processes from the command line using Terminal on your Mac. To do this, first launch Terminal (either using Spotlight or from the Applications > Utilities folder) and run the
top command to see a list of running processes. Alternatively, use the
ps -ax command to see a list of processes along with the process ID (or PID for short).
You’ll need the PID to kill a process, but trawling through hundreds of processes can be a chore. Fortunately, we can identify processes using the
ps ax | grep AppName command, where AppName is the name of the application you want to find.
For example, typing
ps ax | grep Safari will return a list of processes with “Safari” in the title. Be aware that this command is case-sensitive, so searching for “steam” will return different results to “Steam”
Take note of the PID number next to the process you want to kill, then kill it by running the
kill PID command. For example,
kill 3500. To kill a process immediately (also known as force quit) use
kill -9 3500 instead.
You can also kill a process using its name with the
killall command, for example
killall Safari. This will kill all processes with “Safari” in the name (again, processes are case-sensitive).
How to Kill a Mac Process on a Specific Port
If you need to kill a process that’s using a particular network port on your Mac, you’ll first need to find out which process is using that port. Fortunately, this is easy to do using Terminal. The command differs depending on which version of macOS you’re using.
For modern Mac computers (including Apple Silicon models) running macOS El Capitan or later, use the
lsof command, for example:
lsof -i tcp:51413 to find the process that’s occupying port 51413. On older Mac computers you can use
netstat, for example:
netstat -vanp tcp | grep 51413 to find the process on port 51413.
Once you have the PID, you can then end it using the
kill command as outlined above. If you’re using
lsof, you can immediately kill a process based on the port it is using with the
kill -9 $(lsof -ti:portnumber) command, where
portnumber is the port in question.
RELATED: Why Are Some Network Ports Risky, And How Do You Secure Them?
How to Force Quit Apps in the Dock
If the process you want to quit is an app in your dock, you can force close it which should kill it even if it has crashed and become unresponsive. To do this, find the app in your dock and right-click (or control-click) then hold the “Option” key on your keyboard and choose “Force Quit” at the bottom of the list.
You can force quit anything, whether it has crashed or not, but you’re more likely to lose unsaved progress by doing so. If you find that you frequently need to do this, learn how to troubleshoot crashing apps on your Mac.