Force-quit with ps-ax/kill

More often than not, when an application doesn’t respond and you want to force-quit, you just need to press command+option+Esc, select the application from the pop up menu, and that’s it (another option is to ctrl-click the icon on the dock, and the force-quit option will be there).

However, there are times in which not even that will work. There is another slightly more effective method:

a) Open a terminal (you can use the one embedded on OS X via Applications–>Terminal)
b) Enter “ps -ax | grep -i <name of the application>” (without the quotes). A list of processes will print.
c) Find the PID (process identification number, on the first column) of the application you want to quit.
d) Enter “kill -9 <PID>” without the quotes and that’s it.

Things to consider: if you just enter “ps -ax” the complete list of processes will print. You could still just find the PID of the application you want to quit and it’d be the same, but it’d be more troublesome to find it. As a rule of thumb, do not mess with any process that isn’t in the Applications/ folder unless you know what you’re doing. Also, consider that no changes will be saved -just like with the more typical, GUI-based force-quit method.

Technorati Tags: , ,

Similar Posts:

I Like This Tip!


3 Responses to “Force-quit with ps-ax/kill”

  1. Alternatively, you could get the Process Identification Number from the Activity Monitor utility and then only enter the last command.

  2. 4Avatars
    conann
    Kill -2 or 6 is a good friend if you want to kill a process but keep the program.

    to find the PID I use the "top" command in a shell

  3. 4Avatars
    Rob
    Yeah, great, but what do I do if kill -9 doesn't do the trick? Of course, "force quit" doesn't either. Do I have to reboot to get rid of that program?

    The process is in state E (willing to exit) for minutes now, and I can kill it as often as I like without results. Something is seriously broken in Mac OS...

    robert@apfel:~/fm> date
    Tue Jul 8 17:49:05 CDT 2008
    robert@apfel:~/fm> ps ax | grep -i parall
    187 ?? S 0:07.38 /Library/StartupItems/Parallels/pvsnatd
    1246 ?? E 0:00.00 (Parallels)
    1299 p3 R+ 0:00.00 grep -i parall
    robert@apfel:~/fm> kill -KILL 1246
    robert@apfel:~/fm> ps ax | grep -i parall
    187 ?? S 0:07.41 /Library/StartupItems/Parallels/pvsnatd
    1246 ?? E 0:00.00 (Parallels)
    1306 p3 S+ 0:00.00 grep -i parall
    robert@apfel:~/fm> date
    Tue Jul 8 17:54:34 CDT 2008
    robert@apfel:~/fm> ps ax | grep -i parall
    187 ?? S 0:07.41 /Library/StartupItems/Parallels/pvsnatd
    1246 ?? E 0:00.00 (Parallels)
    1309 p3 R+ 0:00.00 grep -i parall

Post a comment to "Force-quit with ps-ax/kill"



MacTips Newsletter


Twitter MacTips

  • Stay up to date with the latest Mac tips, tricks and news by following us on twitter: MacintoshTips.

AppleGazette Headlines

Most Popular Tips (30 Days)

Most Commented (30 Days)

Good Tips

Recent Discussions

MacTips Poll

What level of tips would you like to see?

View Results

Loading ... Loading ...

Friends of MacTips

Subscribe to MacTips

Site Links