The Trash will not empty on a Mac: item in use or locked
· 6 min read
When the Trash will not empty, the cause is nearly always one of three things: an app still has the file open, the file is marked Locked, or you lack permission to remove it. Each has a short fix. Work through them in the order below, from the least to the most involved, and you can clear almost any stubborn item without using Terminal.
Read the message Finder shows before you start. “The operation can’t be completed because the item is in use” points at an open file. “Locked” points at the Locked checkbox. “You do not have permission” points at ownership.
Step one: close whatever might be holding it
An item is “in use” when a program has it open. That includes the obvious cases and a few sneaky ones.
- The app that created the file, even if no window is showing. Quit it with Command-Q rather than closing its window.
- A disk image that is mounted. If the item in the Trash is a .dmg file you installed from, eject the mounted disk first. Look for it in the Finder sidebar under Locations, or on the Desktop, and click the eject button.
- A file still being synced, uploaded or previewed. Wait a minute, or pause the sync for a moment.
- A video or audio file a player still has loaded.
Try Empty Trash again. If you are not sure which app is responsible, restart the Mac and try straight after login, before you open anything. A restart closes everything that had a file open and solves a large share of “in use” errors.
Step two: unlock a locked item
Finder lets any file be marked Locked, which protects it from being changed or deleted. Locked items in the Trash block a normal empty.
The quickest method is to hold the Option key when you choose Empty Trash. In Finder, click the Finder menu, hold Option, and the command changes to Empty Trash without the usual locked-file warning, deleting locked items as well. Finder asks you to confirm.
If you would rather unlock the item first:
- Open the Trash and select the item.
- Press Command-I to open Get Info.
- Untick Locked, then close the window.
- Choose Empty Trash again.
Note that “Locked” here has nothing to do with passwords. It is a simple flag that stops accidental changes, and anyone can untick it. Locked in Finder is not password protected covers what the box really does.
Step three: check permissions
Sometimes the file belongs to another user, or to the system, and you are not allowed to remove it. You see a message about permission rather than use.
- Select the item in the Trash and press Command-I.
- Open Sharing & Permissions at the bottom of the window. Click the padlock if it is closed and enter your password.
- Set your account to Read & Write, or add yourself with the plus button.
- Try emptying the Trash again.
Be honest about what you are removing before you change permissions. Files owned by the system or by another account on a shared Mac sit there for a reason. If the item came from an app you uninstalled, it is safe to remove. If you do not recognize it, What is this folder on my Mac? Finding the app that made it helps you identify it first.
Step four: restart in Safe Mode
If an item still resists, a Safe Mode start loads fewer background programs, which can release a file that something is holding in the background.
- Apple silicon. Shut down, then press and hold the power button until startup options appear. Select your disk, hold Shift, and click Continue in Safe Mode.
- Intel. Restart and hold Shift until the login window appears.
Log in, empty the Trash, then restart normally. If it works here, a startup item or extension was the culprit, and it is worth noticing which one you installed recently.
Step five: see the flags in Terminal
Terminal is the last resort, and the first thing to do in it is look, not delete. Terminal needs Full Disk Access to read your Trash. Add it in System Settings, Privacy & Security, Full Disk Access, then restart Terminal.
List the Trash with its flags:
ls -lO ~/.Trash
An item showing uchg in the flags column carries the Locked flag. Remove the flag on one named item with:
chflags nouchg ~/.Trash/"Name of the item"
Then empty the Trash in Finder. Typing the name after ~/.Trash/ keeps the command limited to that one item. Avoid rm -rf with wildcards in the Trash; one mistake in the path deletes the wrong thing, and there is no undo.
Does space come back afterward
Emptying the Trash frees the space immediately in most cases, but not always. Snapshots, caches and other copies can hold on to it. If the numbers still look wrong, You emptied the Trash but your Mac got no space back explains where the space goes. And if you want to know what happens to a file once it leaves the Trash, Delete a file for good on a Mac goes through it.
Questions
Why does it say an item is in use when nothing is open? A background process, a sync tool or a mounted disk image can still hold it. Eject disk images, quit the owning app with Command-Q, and restart if you cannot tell which one it is.
Is it safe to hold Option and empty the Trash? Yes, if you are sure you want everything in the Trash gone. It skips only the locked-file warning, not the confirmation, and deleted items cannot be recovered afterward unless you have a backup.
Can I empty the Trash for just one item? Yes. Right-click the item inside the Trash and choose Delete Immediately, then confirm. It follows the same rules about locks and permissions.