How to kill a program or process in OS X

by Ross McKillop on June 4, 2007

Mac

The following tutorial will show you how to kill programs/processes in OS X.

Use the following information very carefully. Killing processes in OS X can cause system instability and full scale OS crashes. With that said, this tutorial will show you how to ‘quit’ a program or process when it’s not listed in the dock, “Force Quit” menu etc.

  1. Typically when you’re looking to force something to quit, it’s because the program or process is eating up a ton of CPU. To identify the program/process, open an OS X terminal by going into your Applications -> Utilities and selecting Terminal. Once a terminal has opened, you can get a list of the running programs by entering the command top.
  2. the top command in an osx terminal
    click to enlarge

  3. To quit the top program simply hit the q key on your keyboard. As seen above, the default “sorting” for the top command is by PID (Process ID). Since this doesn’t always help identify which program is hogging your CPU, run top with the following string: top -o cpu

    That will launch top and sort the processes by which ones are using the most CPU. In the example below you’ll see that top itself is actually using the most CPU.

  4. the top command in an osx terminal sorted by cpu
    click to enlarge

  5. Again, hit the letter q to quit top. If you’ve identified the program you want to end, make note of it’s PID. In the screenshot below I’m using MozyBackup as my example, and it has a PID of 1488
  6. the top command in an osx terminal sorted by cpu
    click to enlarge

  7. To quit MozyBackup, enter the command kill -9 1488. Broken down, that’s kill (the command to ‘kill’ a program) -9 (the “non-catchable, non-ignorable kill” - basically it means kill this program no matter what) and 1488 (the PID that you want killed).
  8. killing processes in the osx terminal
    click to enlarge

  9. As you’ll see in the above screenshot, I was unable to kill the PID 1488. That’s because the program in question wasn’t owned (being run) by me - rather, it was being run by the root user. To get around this, and use this command with care, enter sudo kill -9 1488. You’ll be asked for your password, and after entering it, the process 1488 will be killed.
  10. killing processes in the os x terminal
    click to enlarge

  11. For detailed information on the top and kill programs, enter man top or man kill from the terminal to view the manual pages for each program.
Related Posts:
  • How to get detailed information on each running process in Windows
  • How to allow a program through the Windows Vista Firewall
  • Did you know.. How to use your favorite email program with Gmail
  • How To Turn Any Video File Into A DVD Player Playable Disc
  • How to keep any Windows program “always on top”
  • Get Simple Help tutorials just like this one in your email inbox every day - for free! Just enter your email address below:

     

    You can always opt out of this email subscription at any time.


    Bookmark and Share

    { 1 trackback }

    Kill command on OS X at Rage on Omnipotent
    10.17.07 at 5:17 am

    { 1 comment… read it below or add one }

    1 Jaime King 09.24.08 at 6:52 pm

    Thank you so much I spent a LONG time trying to figure out why my macbook was running so slow and the fan was on full blast. I wish I had seen this site before i talked to that clueless tool on Apple’s tech support line

    Leave a Comment

    You can use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>