Force Kill An App On Mac From Terminal

Posted on  by 

When you start an app, the operating system creates a process for an executable file of the app. It contains the program code and its current activity. Windows assigns a special number known as Process Identifier (PID) which is unique for every process. There are a number of reasons you might want to kill a process, and different methods you can use to terminate it. Here is how it can be done.

  1. Force Kill An App On Mac From Terminal 1
  2. Force Kill Application Mac
  3. Mac Os Force Kill Process
  4. Force Kill An App On Mac From Terminal 4
  5. Force Quit Applications On Mac
  6. Force Kill An App On Mac From Terminal 2
  7. Force Kill Mac Terminal

RECOMMENDED: Click here to fix Windows errors and optimize system performance

Force Kill An App On Mac From Terminal 1

Aug 28, 2019  Right-click on the app you want to quit on the dock (Mac’s dock), at the bottom of the screen. Press Alt (or Option) and then select “ Force Quit ” from the menu. The selected application will automatically be closed, without any alerts or confirmations. Force Quit A Program On Mac From Menu.


If an app stops responding, consumes a lot of system resources or behaves unexpectedly and doesn't allow you to quit it, you might want to kill its process to forcefully close the app. Traditionally, Windows allowed using Task Manager and the command prompt for these tasks. In addition to these methods, you can use PowerShell. Here is how.

To kill a process in Windows 10, do the following.

  1. Open Task Manager.
  2. Click on 'More details' in the bottom right corner to enter Full view mode.
  3. Select the desired app in the app list.
  4. Click on the End task button or hit the Del key on the keyboard.

You are done.

This is Task Manager's most well known method.

Note: The same can be done from the Details tab. It is a special tab which lists process names instead of app names. There you can select a process in the list and either click on the End process button or hit the Del key.

Force Kill Application Mac

Using the End Task button means Windows first tries to see for a certain timeout if the process has really stopped responding, and attempts to collect a crash or memory dump of the process. It then terminates the app.

Mac Os Force Kill Process

Tip: We highly recommend you read the article How to end a process quickly with Task Manager in Windows 10 to learn all Task Manager tricks. Also, you can get the classic Task Manager app in Windows 10 to end processes or tasks.

Another classic method to close a process is the console tool taskill. It comes bundled with modern versions of Windows.

Kill a process using Taskkill

Note: Some processes are running as Administrator (elevated). In order to kill them, you need to open an elevated command prompt instance.

  1. Open the command prompt as the current user or as Administrator.
  2. Type tasklist to see the list of running processes and their PIDs. Since the list might be very long, you can use a pipe character with the more command.
  3. To kill a process by its PID, type the command:
  4. To kill a process by its name, type the command

For example, to kill a process by its PID:


To kill a process by its name:


Taskkill supports many useful options which you can use to terminate apps. You can learn them by running it as follows: taskkill /?. Using taskkill, you can close all not responding tasks at once in Windows 10.

Kill a process using PowerShell

Note: To kill a process which runs elevated, you need to open PowerShell as Administrator.

  1. Open PowerShell. If required, run it as Administrator.
  2. Type the command Get-Process to see the list of running processes.
  3. To kill a process by its name, execute the following cmdlet:
  4. To kill a process by its PID, run the command:

Examples:
This command will close the notepad.exe process.

The next command will close a process with PID 2137.

If you need to kill a Store app, see the following article:

From

That's it.

RECOMMENDED: Click here to fix Windows errors and optimize system performance

Everyone knows how to kill a program using Task Manager in Windows or Force Quit in OS X, but sometimes it’s useful to kill a program using the command line. I’ve run into several situations where the program refused to end via Task Manager, even when I tried to kill the underlying process. Force Quit has it’s own quirks and doesn’t always kill a program like it should. That’s when you can use the power of the command line.

In this article, I’ll go through the commands for killing a program in Windows, OS X and Linux. Interestingly, there is usually more than one command for accomplishing this, so I’ll try to mention the different ones that I have used. It’s not an exhaustive list, so if you use a different command not mentioned here, please let us know in the comments.

Windows – TSKILL and TASKKILL

In Windows, you can use two commands to kill a program: TSKILL and TASKKILL. TSKILL is a simpler and less powerful command, but does the job just fine. For example, if you’re running Microsoft Word, the process name is winword.exe. To kill Word from the command line just type the following command:

Kill

That will kill Word and you will lose any unsaved data, so you have to be careful using it. I tried it out on an unsaved Word doc and it just disappeared when I ran this, no prompts to save the documents. This is pretty much true of all the commands I’m going to mention here as that’s kind of the point. You can to kill a program instantly without any questions.

Force Kill An App On Mac From Terminal 4

One thing to note is that most of the time that this command is used, it’s used with the /A parameter. /A tells the command to end the process running under all sessions. So typically you would type the following command to be extra sure the process is killed:

The second command, which has more options and is more powerful, is TASKKILL. If you look at the help page for TASKKILL, you see what I mean:

If you want to have more control and options for killing a program in Windows, use TASKKILL. For starters, you can kill a program by using the following command:

Note that you have to use .EXE when using the TASKKILL command. /F means to forcefully terminate the process forcefully. /IM means the image name, i.e. the process name. If you want to kill using the process ID (PID), you have to use /PID instead of /IM. /T is great because it will kill all child processes started by the specified process.

You can also use TASKKILL to remotely connect to another system and kill a process on that remote system. What I also like is the ability to use wildcards in TASKKILL.

OS X/Linux – KILL and KILLALL

In OS X and Linux, you have two commands for killing processes: KILL and KILLALL. You have to run these in the terminal window. In order to kill a program, you either have to use the program name or the process ID. There are some ways you can find this info. One way is via the Activity Monitor.

However, that requires the GUI interface. If you are using the command line to kill a process, you can use the command line to find the process info also. Two commands that come to mind are top and ps -ax.

top will give you a list of processes with the PID and the program name also sorted by CPU usage. It’s a quick way to find the process you want to kill. ps -ax will give you a listed sorted by PID and the path of the program. It’s slightly different than top.

Force Quit Applications On Mac

Now for killing the program in OS X. You can simply type the following command to kill a specific process:

83002 is the Terminal process and the 9 means to kill the process. You can use other numbers like 3, which means Quit, or 6, which means Abort. Mostly, though, you’ll be sticking with 9. You can also use the KILL command to kill all running processes, though you should probably never use this command.

Force Kill An App On Mac From Terminal 2

Where KILL is useful for killing one process or all processes, KILLALL is using for killing a group of processes. For example, if you’re running Google Chrome, you might have 10 Chrome processes running. It would be really annoying to use KILL ten times to shut down Chrome. Instead, you could use KILLALL like so:

Force Kill An App On Mac From Terminal

Note that you have to use the single quotes or anything longer than one word. Also, if the process is not running under your name, but is instead running under root, you have to use the following command:

or

Again, the 9 is sending the specific signal to KILL rather than TERM. Sudo is only needed if you get an error about not having permission. Otherwise you can do killall program or killall -9 program. On OS X, the KILLALL command comes in really handy when you can’t force quit a program. You don’t have to know the process ID, which is nice. Just type in the name and all processes will be killed associated with that name.

Force Kill Mac Terminal

This article was meant to give you more advanced methods for killing a program in Windows, OS X and Linux. If you have any questions about killing a program using the command line, post a comment and I’ll try to help. Enjoy!

Coments are closed