How To Quit An App In Terminal Macos

  1. How To Quit An App In Terminal Macos Download
  2. How To Quit Applications On Mac Using Terminal
  3. How To Quit A Program In Terminal Mac
  4. How To Quit An App In Mac
  5. How To Quit An App In Terminal Macos Linux

When Mac apps misbehave, sometimes you need to force quit apps to shut down. This can happen when the app enters an infinite loop, crashes, hangs or otherwise ceases responding to user input. While it’s never an ideal way to close an application, it doesn’t generally hurt the app.

When you force quit an app, you are basically forcefully closing it. While this will quickly kill the app from the RAM, in many cases, it would do so without saving any of your work. How to Quit or Close Apps on Mac Use the macOS Menu bar. When you open an app on the Mac, the menu bar on the top adjusts itself accordingly. In the Terminal app on your Mac, in the window running the shell process you want to quit, type exit, then press Return. This ensures that commands actively running in the shell are closed. If anything’s still in progress, a dialog appears. If you want to change the shell.

You won’t have a chance to save your work, of course, but with many Mac apps (especially Apple’s own macOS apps) auto-saving progress at regular intervals, that’s become less of an issue. So when you force quit apps on Mac, you will lose any data since your last save but won’t otherwise injure the program.

There are a couple of methods we can use to force quit apps on Mac which we will look at below.

1. The Simple Method to Force Quit Apps

The first, and simplest, way to try and force quit an app when it’s misbehaving is to use the Finder in macOS.

To do this, just click the Apple icon at top-left corner of the desktop, then select “Force Quit” from the list.

This will bring up the “Force Quit Applications” box. Find the app you want to force quit here, then click Force Quit at the bottom right corner.

2. Use the Dock

Force-quitting applications through the dock is the most familiar method for most users. It’s intuitively obvious and generally effective.

1. Right-click on the icon of the misbehaving application.

How To Quit An App In Terminal Macos Download

2. Hold down the Option key to reveal the “Force Quit” option.

3. Click “Force Quit” to force the application to close.

3. Use the Force Quit Menu

Your Mac also has a menu made specifically for forcing applications to shut down.

1. Click the Apple icon at the left of the menu bar at the top of your screen.

2. Select “Force Quit …” from the drop-down menu. You can also press Option + Command + Escape to open this menu.

3. Click on the name of the application in red with “(Not Responding)” next to it.

4. Click the “Force Quit” button in the bottom right of the window.

4. Use Activity Monitor to Force Quit Apps

Activity monitor also has the power to close apps. It lets you get a better handle on apps that have silently failed in the background. If you’re not actively using an application and it hits a weird hang, you might not know anything has happened. Because Activity Monitor shows the status of all open applications, you can see at a glance if any apps need to be force quit. You can also use it to quit processes, which are like sub-applications that don’t have Dock icons.

1. Open Activity Monitor by typing “Activity Monitor” into Spotlight.

2. Click on the application or process that shows in red text with “(Not Responding)” next to the application name.

3. Click the button with an X on a stop sign in the upper-left of the Activity Monitor window.

5. Use Terminal to Force Quit Apps

If you’re dealing with an application that won’t respond to force quit commands, Terminal’s kill command can shut the app down hard. It’s the most dramatic way to force an application or process to stop, but in our experience, it’s always effective.

1. Open Terminal by typing “Terminal” into Spotlight.

2. Type the following command to find the process number of the hanging application:

Replace [Application Name] with the name of the application you want to force quit. For example, to find Chrome, we would type the following:

This will simply show all the running applications that have that application’s name in their disk location. It won’t quit anything yet.

3. Scan the resulting list for the correct application or process. Take note of the four- or five-digit number shown before the process’s name. This is the process ID, or PID, which will be used to kill the application.

Here we can see that Chrome has the PID 2745. If you get multiple results for the application, look for the one that ends in /Contents/MacOS/[Application Name].

4. Type kill followed by the PID from the last step. For example, kill 2745 will shut down the process with the PID 2745.

Conclusion

Force-quitting Mac applications shouldn’t be your primary method of closing applications, of course. But it’s a necessary tool for stopping applications that can no longer respond to user input.

You might also like the following posts:

Getting Started with Terminal: Hide Files on macOS

Getting Started with Terminal: Must-Know macOS Terminal Commands

Completely Remove and Uninstall Apps from macOS

When doing any type of programming or scripting, I do my best to streamline everything (see this post and this post). Basically anything I do in the Terminal that can be automated, I try to automate. In addition to the posts linked above, I also have macros set up to login me into the supercomputer that I do most of my research on.

When I first open Terminal, I have it set to open 4 Terminal windows in specified locations. For those of you who don’t know how to do this, I will soon be providing a post detailing the necessary steps to accomplish this.

I also have a macro set to log me off of the supercomputer in each Terminal window and close the Terminal windows. But, that still leaves me with the task of actually quitting the Terminal application. Many of you may think “who cares if you have to hit command+q”. Well, as I mentioned previously, I like to automate as much as possible.

I was able to find a bash script that can quit any running application from the Terminal. This is easily accomplished using the kill command, however the kill command will not save any work that is currently open. This quit script uses osascript:

The script can be found at Jon Stovell’s site, or on macupdate.

How To Quit Applications On Mac Using Terminal

There have been a few modifications to the script by some of the users, and the modifications have been posted in the comments section of the MacUpdate website. I have added a few of these modifications to the script, and you can download the modified version here.

How To Quit A Program In Terminal Mac

For instructions on how to use the script, just run it.

How To Quit An App In Mac

How To Quit An App In Terminal Macos

How To Quit An App In Terminal Macos Linux

Related articles