When the Trash will not empty on a Mac

"The operation cannot be completed because the item is in use." Here is which item, and how to find out.

There are four reasons the Trash refuses, and the error message rarely tells you which one you have. Work through them in this order.

1. Something still has the file open

The commonest cause by far. An app that opened the file has not let go, even if you closed its window.

macOS names the file in the error dialog. Take that name and ask which process is holding it:

lsof | grep -i "filename"

The first column is the process. Quit that app and try again.

If you cannot work out which app, the fastest fix is a restart — nothing survives it holding a file handle. Failing that, log out and back in.

A specific case worth knowing: files inside a mounted disk image. If a .dmg is still mounted, its contents cannot be removed. Eject it first.

2. The file is locked

macOS has a per-file locked flag, separate from permissions, and locked files refuse to delete quietly.

Select the file, press Command-I, and look for the Locked checkbox at the top of the Get Info window. Untick it.

For a folder full of them:

chflags -R nouchg ~/.Trash/*

Then empty the Trash as normal.

3. Permissions

Files that arrived from another user account, an old backup or an external drive formatted elsewhere may not be yours to delete.

Take ownership of everything in your Trash:

sudo chown -R "$(whoami)" ~/.Trash/*

Then empty it. You will be asked for your password, which is expected — you are changing ownership of files.

4. The Trash you cannot see

Every volume gets its own Trash. Deleting a file from an external drive puts it in a hidden .Trashes folder at the root of that drive, and it stays there occupying space until emptied while the drive is connected.

If an external disk is mysteriously full:

sudo du -sh /Volumes/YourDrive/.Trashes

Connect the drive, then empty the Trash with it mounted. That clears both.

The forceful option

When all four have failed, delete the contents directly:

rm -rf ~/.Trash/*

Two things to understand before running that. It bypasses the Trash entirely, so there is no undo — the files are gone. And a typo in that command is genuinely destructive, so read it twice. In particular, ~/.Trash/* and ~/.Trash /* are very different commands, and the second one is a catastrophe.

If you are at all unsure, use Finder’s Delete Immediately instead: select the items in the Trash, then File → Delete Immediately, or press Option-Command-Delete. Same effect, no chance of a typo.

Secure Empty Trash is gone

You may remember an option to overwrite deleted files. Apple removed it in El Capitan, because on an SSD it did not do what it claimed — wear levelling means the drive decides where writes land, so overwriting a file’s old location is not guaranteed to touch the original blocks.

If you need a file genuinely unrecoverable on an SSD, the answer is full-disk encryption. Turn on FileVault in System Settings → Privacy & Security, and every deleted file is already ciphertext without the key. That is the real protection, and it works on files you deleted last year too.

The space did not come back

You emptied the Trash and Storage settings shows no change. Two likely explanations.

Storage settings is cached and lags, sometimes by hours. Check the truth:

df -h /System/Volumes/Data

Or the file is still held by a Time Machine local snapshot, which keeps a reference to it even after deletion. That space is purgeable and macOS returns it when needed, or you can force it:

sudo tmutil thinlocalsnapshots / 20000000000 4

A note on emptying automatically

macOS can remove items from the Trash after 30 days — Finder → Settings → Advanced → Remove items from the Trash after 30 days.

I leave it off. The Trash is a safety net, and a safety net with a timer is one that eventually fails on the day you need it. Emptying deliberately takes two seconds and means you know what went.