72

So, what do you do on a Mac when a process (as opposed to an application) is hogging CPU, swamping your machine, and you need to kill it?

I know you can use top or open “Applications > Utilities > Activity Monitor” and kill it from there.

But what happens when the process is already using so much CPU that doing either of those tasks is impossible?

On Windows, you can just do ctrl+alt+delete and the process list will reliably open. So no matter how much your computer is thrashing, you always have access to the list of processes.

On Mac OS, there’s cmd+alt+escape, which reliably shows running applications. Fine when it’s an application causing the problem. But: what do you do if it’s a process?

7
  • 4
    Sure. Cmd/Alt/Escape only shows applications: I want it to show all processes.
    – AP257
    Commented Sep 24, 2010 at 8:53
  • @Bobby - it sounds like you've never worked on a Mac and had to use Force Quit. I'm pretty sure AP257 got it right.
    – jww
    Commented Jun 21, 2014 at 13:24
  • @noloader: Well, I've got no idea what I tried to say with that comment...
    – Bobby
    Commented Jun 21, 2014 at 13:26
  • @AP257 - another useful one Macs are missing is a way to quickly lock the Mac. Like Windows' Ctrl/Alt/Delete → Lock Workstation.
    – jww
    Commented Jun 21, 2014 at 13:27
  • "kill -9 p-id" worked like a champ for me. Thanks guys Commented Mar 1, 2021 at 23:19

7 Answers 7

49

Based on your desire to kill an individual process, I'm assuming that you are ok with a solution at the Terminal. The Terminal is pretty light so should be responsive even if your system is swamped, or if you're logging in via ssh.

Beyond the basic kill command, which kills processes via their pid (which you'd need to get from either a ps command, or the Activity monitor), a neat trick at the terminal is the killall command, which allows you to kill a process by name rather than pid.

For example, if you know the name of your process is my-prog-0 or whatever, you can go to the terminal and do:

% killall my-prog-0

There are a number of good options (see man killall for more info):

-s : Shows the kill commands that will be generated so you can be safe.
-u : Limits to a specified user

One thing to note about OS X is that some system processes will be automatically restarted if they are killed by the launchd daemon (I think??). For example, if the Dock is not responsive you can do a killall Dock and it will restart automatically.

5
  • Thanks for the detailed answer and suggestions, even though it doesn't really solve the problem. Terminal can take a few minutes to start up if the machine is trashing.... and by the time it's started up, the mystery background process has usually gone away... Thanks anyway.
    – AP257
    Commented Sep 25, 2010 at 11:45
  • If that's the case then I'm not sure there's much to be done, other than figuring out what causes this thrashing process to occur and then avoiding these conditions.
    – dtlussier
    Commented Sep 25, 2010 at 17:39
  • Why is the 0 necessary? Commented Apr 22, 2016 at 14:44
  • A '0' is not necessary. It was included in the answer because it is typical that processes have numbers in their name. The important thing is to match the name of the process you want to kill.
    – dtlussier
    Commented Apr 23, 2016 at 18:48
  • @dtlussier Typical that processes have numbers in their name? I've never seen that, well, ever. What applications are you speaking of?
    – SilverWolf
    Commented Mar 4, 2019 at 3:37
33

Force Quit is the alternative to Task Manager on Mac. It's fast, efficient, and kills applications really fast.

You can access this feature through two ways.

  1.  Apple Icon (on the top left corner of the screen)--> Force Quit...
  2. Hold Alt/Option +  Apple/Command + Escape. This can be useful if you memorised the keyboard command and in the rare case that Finder misbehaves and freezes along it too.
2
  • 7
    Yes, it kills applications. That's my point! There's a background process on my machine that sometimes causes the machine to slow down massively. Force Quit doesn't show it.
    – AP257
    Commented Sep 25, 2010 at 11:46
  • 1
    Activity Monitor can be used to show all processes and kill them through there. You can quit them or force quit them within the application.
    – JFW
    Commented Sep 26, 2010 at 13:06
17

Try the following command in terminal to list and search for process using a regex:

ps gx | grep 'Symantec'

The above example is to list all the Symantec related processes. Replace 'Symantec' with your own phrase. Next use variations of kill command. You can either use:

kill pid

Replace pid with actual process id (the first number of a line in the output from above). Or use,

killall

as suggested before. To reiterate another useful suggestion, use

man kill 

to see the manual for the kill command and also scroll down and see related commands which is mentioned under the SEE ALSO section.

9

The is no process killing keyboard shorcut, only for running applications. The only way to kill processes is through Activity Monitor or through Terminal using UNIX commands.

5

Go to activity monitor, find the dock and highlight it. Hit the kill button (Stopsign with X in it, top left).

Force Quit is used for simple applications, while the activity monitor can be used to kill processes.

3

Use Activity Monitor to find the Process you want to kill Look at the PID Using Terminal type Kill PID number and then return.

This assumes you have admin or sudu access

1
0

The easiest way is to select and kill the process using the Activity monitor GUI:

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .