How To Kill An App On Mac Terminal

Kill program Mac OSX terminal can sometimes be necessary

After you su to root in the terminal, type 'ps -ax' and you should see all processes, find the one you want to kill, and 'kill -9 #INSERT PROCESS ID HERE#' i forget what the -9 is for, but it's good in case something doesn't want to be killed, so -9 is kind of like a kill with extreme prejudice.

Even though OS X is a pleasure to work with, we have all had a program or process freeze up. It won’t quit by using “Force quit”. What do you do now? Fortunately, this can be solved quite easily. To kill program Mac OS X terminal on Leopard / Snow leopard / Lion do the following commands:

How to kill an app on mac terminal 2

Get the ID of the program

How To Kill An App On Mac Terminal Mac

Kill the program

How

How To Kill An App On Mac Terminal Drive

This will give you the number of the processes found (if any). Now just close them with this command

How To Kill An App On Mac Terminal File

So, for example to kill my activity monitor program

Now the offending program will shut down immediately, no matter what it was doing. This is, however, a last resort. You will lose any unsaved changes.

What happens behind the scenes when you kill the program is a bit different from regular operations. Normally, the operating system asks the program nicely to go away. With the above kill command, it simply shuts it down immediately without asking or telling it anything. There you go. Gone.

Has this post got you interested? Would you like to learn how to do more interesting stuff in OS X’s terminal , than just kill a program. Then read these 10 commands. Even more interested? The OS X terminal is built on top of bash, and you can read more about it in this tutorial.

To quit (close) a Mac app normally, choose Quit from the app's menu in the menu bar, or press Command (⌘)-Q. If the app doesn't quit, follow these steps to force the app to quit.

How to force an app to quit

How to kill an app on mac terminal mac

Press these three keys together: Option, Command, and Esc (Escape). Or choose Force Quit from the Apple menu  in the upper-left corner of your screen. (This is similar to pressing Control-Alt-Delete on a PC.)

How To Kill An App On Mac Terminal 2

Then select the app in the Force Quit window and click Force Quit.

You can even force the Finder to quit, if it stops responding: Select Finder in the Force Quit window, then click Relaunch.

Learn more

How to force an app to close on your iPhone, iPad, or iPod touch.