On Windows, press Ctrl + Shift + Esc to open Task Manager, select the frozen app and click End task. On a Mac, press Option + Command + Esc, choose the app and click Force Quit; on Linux, run pkill appname, and only if it is still running a few seconds later, pkill -9 appname.
Force quitting ends the program without letting it save. Give a frozen app 30 seconds or so first; some apps are busy rather than stuck, and recover on their own.
How to force quit on Windows with Task Manager
- Press Ctrl + Shift + Esc. (Microsoft lists this shortcut as "Open Task Manager". Ctrl + Alt + Delete, then Task Manager, also works when the desktop is unresponsive.)
- On the Processes tab, find the program. A frozen app usually shows Not responding in the Status column.
- Select it and click End task, or right-click it and choose End task.
If the app has several processes (browsers do), ending the top-level entry closes them all. For a stuck background process that has no window, look on the Details tab, which lists every process by executable name and PID.
How to force quit with taskkill (Command Prompt)
Useful when Task Manager itself is slow, or in scripts:
taskkill /IM name.exe /F
/IM picks processes by image (executable) name and ends every process with that name; /F forces them to end. Real output from Windows 11, using a test program named stuckapp.exe:
SUCCESS: The process "stuckapp.exe" with PID 12996 has been terminated.
Without /F, taskkill first asks the program to close and reports SUCCESS: Sent termination signal to the process "stuckapp.exe" with PID 39428. A truly frozen app often ignores that request, so add /F if it is still running. If the name is wrong you get ERROR: The process "name.exe" not found. Find the exact name with:
tasklist | findstr /I chrome
To end just one instance, use its PID instead, and add /T to take its child processes with it:
taskkill /PID 63392 /T /F
Real output; the first line is the console host the test program had started:
SUCCESS: The process with PID 46740 (child process of PID 63392) has been terminated.
SUCCESS: The process with PID 63392 (child process of PID 2036) has been terminated.
Ending a process owned by another user or by the system needs an administrator prompt.
How to force quit with PowerShell (Stop-Process)
Get-Process -Name chrome
Stop-Process -Name chrome
Use the name without .exe. Like taskkill /IM, -Name stops every process with that name; use Stop-Process -Id 1234 for one specific process. Stop-Process prints nothing on success and does not ask the app to close politely first: Microsoft's documentation says it is implemented with .NET's Process.Kill method. If nothing matches, you get Cannot find a process with the name "chrome". Verify the process name and call the cmdlet again. For processes owned by another user you need PowerShell running as administrator, and -Force skips the confirmation prompt.
If the frozen program is a server holding a network port, you can also find it by port. Fixing "port already in use" shows how to go from a port number to the process.
How to force quit on a Mac
- Press Option + Command + Esc together, or choose Apple menu > Force Quit.
- Select the unresponsive app in the Force Quit window.
- Click Force Quit.
The Force Quit window only lists apps with a user interface. For background processes, use Activity Monitor (in Applications > Utilities): select the process, click the Stop button in the upper-left corner of the window, then choose Quit or Force Quit. Apple explains the difference: Quit "is the same as choosing File > Quit within an app" and happens when it's safe, while Force Quit makes "the process quits immediately", so "if the process has files open, you may lose data."
In Terminal, the Unix commands work the same way as on Linux:
pgrep -l Safari # find the PID
kill 4321 # ask it to quit (SIGTERM)
kill -9 4321 # force it (SIGKILL), only if it is still running
killall Safari # by exact process name
If the whole Mac is frozen, Apple's advice is to choose Apple menu > Restart, and if that doesn't respond, to press and hold the power button for up to 10 seconds until the Mac turns off.
How to force quit on Linux
By name, from a terminal:
pkill firefox
pkill -9 firefox # only if it is still running a few seconds later
pkill sends SIGTERM by default to every process whose name matches. It matches part of the name, so check what it will hit first with pgrep -l firefox; add -x for an exact name match, or -f to match against the full command line (handy for scripts run as python3 myscript.py). killall firefox does the same by exact name on most Linux systems.
By PID:
ps aux | grep firefox
kill 51234
kill -9 51234
By clicking the window: run xkill, and the pointer becomes a cross; click the frozen window. The X.Org manual describes it as "forcing the X server to close connections to clients", which makes most apps exit. It is an X11 tool, so on a Wayland desktop it may only work for apps running under XWayland, and it may need installing first (on Debian and Ubuntu it is in the x11-utils package). Desktop environments also have a graphical System Monitor that can end processes.
If the whole desktop is frozen, switch to a text console with Ctrl + Alt + F3 (the number varies by distribution), log in, and use pkill or kill from there.
Why you should send SIGTERM before kill -9
Linux and macOS end processes by sending a signal. The two that matter here:
| Signal | Number | Sent by | Can the program react? |
|---|---|---|---|
SIGTERM | 15 | kill, pkill, killall with no option | Yes: it can save, delete temp files, close connections, then exit |
SIGKILL | 9 | kill -9, pkill -9 | No: the kernel ends it immediately |
The signal(7) man page is explicit: "The signals SIGKILL and SIGSTOP cannot be caught, blocked, or ignored." That is what makes kill -9 reliable, and also why it is a last resort: the program gets no chance to finish writing a file, release a lock or remove a PID file. Databases and package managers killed this way can leave files that need repair or a lock that blocks the next run. The kill(1) man page makes the same recommendation: prefer TERM, because the process can handle it and clean up first.
Windows has a similar split: taskkill without /F asks the program to close, while /F, Task Manager's End task on a hung app, and Stop-Process end it outright.
If the program still won't die
- "Access is denied" or "Operation not permitted". The process belongs to another user or to the system. Use an administrator prompt on Windows or
sudoon macOS and Linux, after checking what the process is. - It comes straight back. A service manager or supervisor is restarting it; stop it there instead.
- Linux: the process is in state
Din the STAT column ofps aux, which ps(1) defines as "uninterruptible sleep (usually I/O)". It is waiting on the kernel, typically for a disk or a network file system, and it may not respond even toSIGKILLuntil that I/O finishes or fails. Fix the underlying device or mount; a reboot is sometimes the only way out. - Linux: it shows as
<defunct>(stateZ, a "zombie": "terminated but not reaped by its parent"). It has already exited and uses no CPU; the entry stays until its parent process collects it, so ending or restarting the parent is what clears it.
Frequently asked questions
- Will I lose unsaved work if I force quit?
- Usually, yes. A forced quit ends the program immediately, without giving it a chance to save. Some apps keep autosave or recovery files and offer to restore them the next time they start, but anything not yet written to disk is gone. If the app might recover, wait a minute before forcing it.
- What is the difference between kill and kill -9?
- Plain kill sends SIGTERM, a request to exit that the program can catch so it can save state and clean up. kill -9 sends SIGKILL, which the kernel enforces immediately; the program cannot catch, block or ignore it, so it gets no chance to clean up. Always try plain kill first.
- Why does a process keep coming back after I kill it?
- Something is restarting it: a Windows service set to restart on failure, a launchd job on macOS, a systemd unit on Linux, or a supervisor such as pm2 or Docker's restart policy. Stop it through that manager (for example, sudo systemctl stop name on Linux) instead of killing the process.
- Is it safe to end any process in Task Manager?
- No. Ending system processes can log you out, crash Windows or force a restart. Microsoft's Stop-Process documentation warns that stopping a process can stop processes and services that depend on it, and in an extreme case can stop Windows. End only programs you recognise and started yourself.
Sources
- Microsoft Support — Keyboard shortcuts in Windows
- Microsoft Learn — taskkill
- Microsoft Learn — Stop-Process
- Apple Support — How to force an app to quit on your Mac
- Apple Support — Quit a process in Activity Monitor on Mac
- Linux man-pages — signal(7)
- Linux man-pages — kill(1)
- Linux man-pages — pkill(1)
- Linux man-pages — killall(1)
- Linux man-pages — ps(1)
- X.Org — xkill(1)