How to Find and Stop a Frozen Process Using Terminal on a Mac

Illustration for How to Find and Stop a Frozen Process Using Terminal on a Mac

Quick Answer

Open Terminal, list running processes with ps, identify the frozen app’s process ID (PID), and stop it with kill:

ps -ax | grep -i "ProcessName"

Replace ProcessName with the app or process name. Use the PID from the results in this command:

kill PID

For example, if the PID is 1234:

kill 1234

If the process does not stop, force it to exit:

kill -9 1234

Replace 1234 with the actual PID. The regular kill command gives the process a chance to close cleanly; kill -9 immediately terminates it and may cause unsaved work or incomplete file operations to be lost.

What a Frozen Process Is

A process is a running program or part of a program. An app can appear frozen because its process is using excessive CPU, waiting for another service, or no longer responding to input.

Terminal can help you:

  • Find a process by name
  • See its PID
  • Check whether it is consuming CPU or memory
  • Stop it without restarting your Mac
  • Force it to close when a normal termination does not work

Before stopping anything, save work in other apps if possible. Do not terminate unfamiliar system processes unless you understand what they do. Stopping an essential process can log you out, interrupt system services, or cause other apps to behave unexpectedly.

Open Terminal

You can open Terminal from Applications > Utilities > Terminal. You can also press Command-Space, type Terminal, and press Return.

The commands below do not modify files by themselves. The commands that stop a process do change the state of the running system, so check the PID carefully before executing them.

Find a Frozen Process by Name

Use ps and grep

The ps command displays running processes. The grep command filters that list for a name or search term.

Run:

ps -ax | grep -i "ProcessName"

Replace ProcessName with the name of the app or process. For example, to search for an app named TextEdit, run:

ps -ax | grep -i "TextEdit"

The -a option includes processes associated with other users, while -x includes processes that do not have a controlling Terminal. The -i option makes the search case-insensitive, so TextEdit, textedit, and TEXTEDIT match.

A matching line usually contains several fields. The first numeric field is the PID. Look for the process name near the end of the line, and make sure the match is the actual app rather than the grep command itself.

Terminal showing the command ps -ax | grep -i "ProcessName"
Run this command in Terminal for this step.
ps -ax | grep -i "TextEdit"

The output depends on which processes are running on your Mac, so do not assume that a PID shown in an example belongs to your computer.

Avoid matching the search command

Sometimes the search results include the grep command used to perform the search. You can reduce that confusion by placing square brackets around the first character of the search term:

ps -ax | grep -i "[T]extEdit"

This still finds TextEdit, but the command itself does not contain the exact text TextEdit in the same form.

Use pgrep for a Cleaner PID Search

pgrep searches running processes and prints matching PIDs. It is often easier to read than a full ps listing.

Run:

pgrep -ifl "ProcessName"

Replace ProcessName with the process name. For example:

pgrep -ifl "TextEdit"

The -f option searches the full command line, -i ignores letter case, and -l includes the process name with the PID. If the command returns more than one PID, inspect the names carefully before stopping anything.

For an exact executable-name match, use:

pgrep -x "ProcessName"

This is useful when a short search term might match several unrelated processes. The exact name must match the process name used by macOS.

Terminal showing the command kill PID
Run this command in Terminal for this step.
pgrep -ifl "TextEdit"

If you are unsure which process is consuming resources, top can help you investigate before you stop anything:

top -o cpu

This opens a continuously updating process list sorted by CPU usage. Press Q to quit top. A high CPU percentage does not automatically mean a process is frozen; some apps perform legitimate intensive work.

For a broader explanation of checking CPU use, see how to check which process is using the most CPU on a Mac in Terminal.

Check a Process Before Stopping It

After finding a PID, inspect it with ps:

ps -p PID -o pid,ppid,user,%cpu,%mem,stat,etime,command

Replace PID with the number you found. For example:

ps -p 1234 -o pid,ppid,user,%cpu,%mem,stat,etime,command

This shows:

  • pid: The process ID
  • ppid: The parent process ID
  • user: The account running the process
  • %cpu: CPU usage
  • %mem: Memory usage
  • stat: The process state
  • etime: How long the process has been running
  • command: The command or application associated with it

This check helps prevent stopping the wrong process. Confirm that the command belongs to the app you intend to close.

You can also view a process’s open files and connections with:

lsof -p PID

Replace PID with the process ID. This may produce a long list and can reveal that the process is working with a file, disk, or network connection. Do not close the process merely because it has many open files.

Stop the Process Normally

Send a standard termination signal

The safest Terminal method is to send the process a normal termination request:

kill PID

Replace PID with the confirmed process ID:

kill 1234

This does not provide a reversal command because the process is being asked to exit. If it closes, you can usually reopen the app normally. Any unsaved data may be recoverable only if the app has an automatic recovery feature.

A normal kill command gives the process an opportunity to perform cleanup. Wait a few seconds and check whether it is still running:

ps -p PID

If the command returns no process information, the process has exited. If it still appears, it may be busy, unresponsive, or handling the termination request slowly.

Use pkill only when the match is unambiguous

You can terminate processes by name with pkill:

pkill -TERM -x "ProcessName"

Replace ProcessName with the exact process name. For example:

pkill -TERM -x "TextEdit"

This sends a normal termination signal to every exact matching process. Because more than one process can share a name, using the PID with kill is generally safer. There is no undo command for a process that has already exited; reopen the app if needed.

Force a Frozen Process to Exit

If the process ignores a normal termination request, you can send the force-quit signal:

kill -9 PID

For example:

kill -9 1234

SIGKILL, represented by -9, stops the process immediately. The process cannot clean up or save data first. Use this only after confirming the PID and trying the regular kill command.

This command can result in:

  • Unsaved changes being lost
  • An incomplete file operation
  • Temporary files remaining behind
  • Corrupted data if the process was writing when it stopped

There is no safe reversal for kill -9. Afterward, reopen the app and check the affected files. If the app was working with an external drive or network location, wait for the device or connection to become available before repeating the operation.

Terminal showing the command kill 1234
Run this command in Terminal for this step.
kill -9 PID

The command above is intentionally written with PID as a placeholder. Do not type the letters PID; replace them with the confirmed numeric process ID.

Stop a Process Owned by Another User

A process owned by your account can usually be terminated without additional privileges. If macOS reports that you do not have permission, inspect the process first:

ps -p PID -o pid,user,command

If the process belongs to another account or requires administrator privileges, you may need sudo:

sudo kill PID

Replace PID with the confirmed process ID. Terminal will ask for your Mac login password. The password will not appear on screen while you type it.

Using sudo changes the command’s privileges; it does not make the process safer to terminate. Do not use it unless you know why permission is required. The same warnings about lost data and interrupted operations apply.

For a forceful termination with administrator privileges:

sudo kill -9 PID

Use this only as a last resort. There is no reversal command.

Confirm That the Process Stopped

Check the PID again:

ps -p PID

If the process is still listed, try the normal termination command again only if you are certain it is the correct process. If you used kill -9 and the process remains, it may have restarted automatically or a different process may now have the same function.

You can search by name again:

pgrep -ifl "ProcessName"

If the app reopened or a helper process remains, identify each result before taking further action. Some apps use separate background processes, so stopping one process may not close the entire app.

When the Problem Involves Storage or a File

A frozen app may be waiting for a slow, disconnected, or unavailable storage location. Before force-quitting it, check whether it is working with an external disk, network volume, or large file.

If you need to locate unusually large files that may be contributing to a storage problem, see how to find the largest files and folders in Terminal on a Mac.

Do not disconnect an external drive while an app may be writing to it. First stop the app normally if possible, then eject the volume using Finder or Disk Utility. Forcefully disconnecting storage can interrupt writes and damage files.

If the frozen process is associated with a network connection, stopping it may release the connection, but it will not fix the underlying network issue. For process and port investigation, see how to find which process is using a port on a Mac using Terminal.

Troubleshooting

kill: No such process

The PID may already have exited, or it may have changed. Search again with pgrep or ps and use the current PID.

Operation not permitted

The process may belong to another user, be protected by macOS, or require additional permissions. Do not repeatedly use sudo without identifying the process. If it is a protected system process, stopping it may be unsafe or ineffective.

The process returns after being stopped

A background service, login item, or parent process may be launching it again. Check the process name and parent process:

ps -p PID -o pid,ppid,user,command

Replace PID with the current process ID. If the parent process is also frozen, identify it carefully before taking action. Do not stop a parent process merely because it appears in the output; it may control other important services.

The app is still visible after kill

The graphical window may take a moment to disappear, or another helper process may still be running. Search by name again:

pgrep -ifl "ProcessName"

If no matching process remains but the window is visible, macOS may be refreshing the interface. Give it a moment before repeating commands.

Terminal itself is not responding

Open another Terminal window or tab. If Terminal is unavailable, use Force Quit Applications by pressing Option-Command-Escape, select the unresponsive app, and choose Force Quit. This can also lose unsaved work.

Frequently Asked Questions

Is kill the same as Force Quit?

A normal kill command sends a termination request to a process. Force Quit is a graphical action that also attempts to close an unresponsive app. kill -9 is more severe because it immediately terminates the process without allowing cleanup.

Will stopping a process delete my files?

Stopping a process does not normally delete files by itself. However, interrupting a save, copy, export, or other write operation can leave incomplete or damaged files. Always try the normal kill command first.

How do I find the PID of an app?

Use:

pgrep -ifl "ProcessName"

You can also use:

ps -ax | grep -i "ProcessName"

The PID is the number associated with the matching process.

Can I stop every process with the same name?

You can use pkill, but it may terminate multiple processes:

pkill -TERM -x "ProcessName"

Use a specific PID with kill whenever possible.

Should I restart my Mac after killing a process?

Not usually. Restart only if the app or related system behavior remains unstable, or if you cannot identify which process is causing the problem. Save work and close other apps first when possible.

Final Thoughts

Terminal lets you investigate a frozen app, confirm its PID, and stop it without restarting your Mac. Start with ps, pgrep, and a normal kill command. Use kill -9 only after confirming the process and accepting that unsaved work or interrupted file operations may be lost.