Nov 28, 2019 If you see the dreaded spinning beachball, or an app just won't do anything, you should force quit it. There are several ways to force quit an unresponsive application: Press Command-Alt-Esc and click on the application in the window that opens. Press Force Quit; Control-click or right-click on the application's icon in the Dock and choose. Aug 28, 2019 Force Quit An Active Mac App With Keyboard Shortcut. You can also force quit an active application on Mac by pressing and holding Command + Option + Shift + Esc key for a few seconds until the program forcibly close.
Sep 05, 2014 How to Gracefully Quit Apps from the Terminal in Mac OS X with osascript Again, this will issue a standard quit signal to an application, rather than a kill (terminate) signal. That also means the target application won’t forcibly exit if there is unsaved data without prompting the user for input (unless you have auto-save setting enabled for.
When you run any command in the OS X Terminal, you are running some program that has been coded and compiled to perform a specific function, be it something simple like “ls” to list directory contents, or something more interactive like “top” to display information on running processes. These commands are all programs on your Mac, just like applications such as Pages, Word, TextEdit, and Safari that have graphical interfaces and are the main productivity programs you use when running OS X.
Opening Applications using the Terminal
Most applications in OS X are opened by using a graphical approach like mouse click actions or services like Spotlight; however, you can also open applications using the OS X Terminal. This might seem unnecessary, but it can have its uses. For instance, I have a Mac Mini running the third-party media center software “XBMC” on it. This software sometimes crashes and needs to be relaunched, so while I can screen share to it or rummage for my wireless mouse and keyboard to access it, another approach if I am at my laptop is to simply log in with SSH and use one of several command options for opening the program.
1. Direct executable execution
Applications in OS X are packaged as bundles, which are folders including the executable along with any supporting resources (libraries, images, fonts, etc.) that the program needs to run. You can see these by right-clicking any application and choosing the option to “Show Package Contents.” In this bundle structure, the application executable is located in the /Contents/MacOS/ directory, and can be launched directly in the Terminal by specifying the full path to this executable. For example, you can open Safari by running the following command:
While this will open the specified program, this method has some limitations and restrictions that might cause problems. For one, the program will be launched as a child process of the current Terminal window, so if you close the Terminal window you will close the program. In addition, such behaviors might interfere with Apple’s Resume service and not save any of your open windows for the next time you re-launch your program.
2. The “open” command
My preferred method of opening an application from the Terminal is to use the “open” command with the the “-a” flag to specify the application by name. For example, the following command will open Safari:
This approach mimics opening the program using the graphical interface, and can be useful if you are creating scripts where you would like to open a specific application. You can also use many of the “open” command’s options to do things like launch a new instance of a program (though this may conflict with OS X’s Resume service), or open a program in the background. In addition, since the “open” command launches applications indirectly, once run you can simply close the Terminal window and the application will remain open, as opposed to using direct executable execution.
The “open” command is also useful because you can cleanly launch applications for the current user account on a remote system. For instance, in looking at the XBMC setup on my Mac Mini, when XBMC crashes I can use “ssh” to remotely log in as the current username and then simply run “open -a XBMC” to quickly re-launch it.
3. Osascript approaches
The “osascript” command is OS X’s Terminal command for running “open scripting architecture” scripts like AppleScript. Since with AppleScript you can instruct the system to do things like launch applications, with a relatively basic scripting line like ‘open app “APPNAME”‘ coupled with the “osascript” command, you can create a quick one-line command to open any application on the system. For example, the following command will launch Safari similar to the “open” command above:
Keep in mind that as with the “open” command, this will also require you to be logged into the system as the currently active user. Otherwise you will get an error (-10810) at the Terminal and the specified application will not open.
Quitting Applications using the Terminal
While the “open” command is great for launching applications, this approach will only open them and does not provide a way to quit them. Therefore, the AppleScript approach with the “osascript” command may be the easiest way to cleanly quit a running application using the Terminal. For example, given the command above to open Safari, you can use the following one to easily quit it:
Note that while this will attempt to quit programs, if you have unsaved changes in them and a Save dialogue box or other notice pops up that requires user input to proceed, then the program will not quit.
Force-quitting Applications using the Terminal
If you need to force-quit an application using the Terminal, then this can be done in two ways. The first is to simply use the “killall” command, which allows you to specify a program by name and then the system will internally identify it and close it down. The following command is a way to force-quit Safari (since we’ve been using this as an example so far):
In addition to this, for those who like to delve a little deeper into the Terminal, you can first find the process ID (PID) of the running application and then use the standard “kill” command to force-quit it. There are several ways to get the PID of a running application, but an easy one in the Terminal is to use the “pgrep” command and specify the program name. For example, to do so with Safari you would run the following command: Mac address software, free download.
If Safari is running, then this command will output a single number that is the program’s PID. You can then use “kill PID” (replacing PID with the number) to quit Safari. This approach is a two-step process, but you can lump it all into one command by nesting them together using grave accent symbols to encase the “pgrep” command, such as the following:
What these accent symbols do is first execute the “pgrep Safari” command, and then use the result when running the “kill” command. Therefore, this essentially finds the PID for Safari, and then kills the specified PID.
When a program stops responding in Windows, most users know how to stop it by pressing Ctrl + Alt + Delete on their keyboard, pressing the Task Manager option and closing it from there. That approach doesn’t quite transfer to Linux distributions like Ubuntu, but that doesn’t mean that you’re short of options when a program crashes.
On the contrary—there are quite a few ways to close a program on Ubuntu using CMD. If you’re comfortable using the terminal, you can use commands like killall or xkill to force troublesome programs to close, or you can use the System Monitor app instead.
Using The System Monitor To Force Close a Running Ubuntu Process
While it’s easy enough to close an open process in Ubuntu using the terminal, beginners might not feel comfortable doing this. But an Ubuntu user doesn’t need to go near the terminal to force close a crashed program—you can use the System Monitor app instead.
The System Monitor works a lot like the Task Manager does for Windows PCs. It lists all the running processes on your PC, as well as giving you real-time information on your CPU, RAM, and disk usage. It also allows you to force close any crashed software that won’t respond or close directly.
If it was successful, the process should disappear from your System Monitor processes list. If the program had an open window, this window should also close at this point.
If System Monitor didn’t successfully close the program, you’ll need to try using the terminal instead. https://supernalcoin.weebly.com/what-is-the-best-music-mixing-software-for-mac.html.
How To Close An Open Window Using The xkill Command
In most cases, the System Monitor software will forcefully close a program on Ubuntu. If it doesn’t, then you’ll need to switch to the terminal to close any non-responding programs.
Thankfully, there’s an easy-to-use command called xkill that will allow you to forcefully close any program with an open window.
How To Close Apps On Mac
This will only work for programs that are visibly not responding, including any programs with a GUI window that you can interact with.
Forcefully Closing a Program on Ubuntu Using pkill, kill Or killall Commands
Using xkill requires you to be using Ubuntu with a GUI. If you’re running a headless version of Ubuntu without a GUI installed, such as Ubuntu Server, then you’ll need to use the pkill,kill or killall commands instead.
The kill and pkill commands will terminate any single process running on your PC, while killall will kill all related processes. Some programs (such as Google Chrome) use multiple system processes, so using kill or pkill may not necessarily end them if the program stops responding.
Open Terminal In MacEffective Ubuntu MaintenanceMac Terminal Force Quit App
Even when running software stops responding, Ubuntu gives you the tools to stay in control. Now you know how to close a process in Ubuntu using the terminal, you can take advantage of other cool Linux terminal commands to backup your PC, pause running commands rather than ending them, and more.
Mac Terminal Force Close Application![]() Mac Terminal Force Close App Download
A crashing program should be a rare occurrence, but if it’s happening more often than it should, it could point to a problem with your Ubuntu installation. You’ll need to look into some of the common reasons for Ubuntu crashes to (hopefully) resolve your issues.
Comments are closed.
|
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
December 2020
Categories |