Subscribe to MacYourself via RSSFollow MacYourself on Twitter

Trash won’t empty? The ultimate guide to deleting stubborn files

Trash won't empty? The ultimate guide to deleting stubborn files

Mac OS X occasionally gets hung up on stubborn files and refuses to easily delete them. If you can’t empty your Mac’s Trash, try some of these techniques to get rid of those nasty errors and clear out the junk.

As a Mac user, you’ve probably found yourself in a situation where you needed to force empty the Trash. Perhaps a message like “You do not have sufficient privileges” or “Error code -8003” kept popping up. In many (but not all) cases, troublesome files reside on an external volume or drive. Manually deleting Time Machine backups via Finder – which is a big no-no – commonly triggers these problems, for example. Other times, files on the main boot drive are in use by running applications and cannot be removed. There’s no shortage of possible scenarios.

Unfortunately there is no single solution for fixing a Mac with a Trash that won’t empty. So, much like MacYourself’s ultimate guide to ejecting a stuck disc article, we will explore a number of potential fixes. We’ll start off with the easiest and most common techniques first, then gradually move to the complex stuff that should only be attempted in the most dire situations. By the end, something should resolve your problem. Good luck!

Restart, then force empty

It’s amazing how many computer issues a simple system restart can fix. So, naturally, that is where we will start. But if you still can’t completely empty the Trash after restarting, let’s try forcing the issue. Click on the Trash icon in the Dock to open it in Finder. Hold down the Option key while clicking the “Empty” button. Still nothing? How about going to the Finder menu and selecting “Secure Empty Trash”?

Unlocking & renaming files

Are you getting an error that says the operation could not be completed because the item is locked? The first thing to do is look at the file(s) or folder(s) that are stuck. Do they have weird names? Remove any unusual characters (especially slashes), then try emptying the Trash again. If that doesn’t work, right-click on one of the stubborn files/folders and select “Get Info.” Is the “Locked” option checked? Uncheck it, close the Get Info window, and repeat this process for other locked items in the Trash. Try Option-clicking the “Empty” button now.

Third party applications

While applications from third party developers aren’t ideal for fixing OS X issues like this, they are a lot easier (and safer) than the next two techniques. Therefore, they’re worth a shot before moving on. Try downloading and installing the free Trash It! program. It just might be the answer to your prayers.

Repair disk & repair permissions

Sometimes files become corrupt and need some attention before they can be deleted. Insert your Mac OS X disc and boot to it by holding down the C key as your Mac turns on. When the disc has finished loading, go to “Disk Utility” under the Installer or Utilities menu (depending on your version of OS X). Click on your hard drive in the list to the left, then click the First Aid tab, and finally the “Repair Disk” button. If any errors are listed when it’s done, click “Repair Disk” again to make sure the error doesn’t come up a second time.

Next, click the “Repair Disk Permissions” button and let it scan the drive. This only needs to be done once. Repeat the “Repair Disk” and “Repair Disk Permissions” process for any external volumes or drives listed in Disk Utility as well. When finished, restart your Mac and try to force empty the Trash (as described above).

Terminal trickery

Now we’re getting into the ugly (but apparently necessary) stuff. I should warn you that executing the following command in Terminal could erase all of your data if you do not follow directions exactly. Backing up before proceeding is always a good idea, just in case. Launch Terminal, which is located in Applications > Utilities, and type the following command.

sudo rm -rf ~/.Trash/

This command temporarily takes advantage of the Root user (the “sudo” part) and deletes the data in your own user account’s Trash directory. Press Enter/Return to execute it. You will likely be prompted for your administrator password – type it and press Enter/Return again. Note that the cursor will not move and none of the characters you type will be shown. When the job is done, type “exit” (minus the quotes) and press Enter/Return before quitting Terminal.

Conclusions

Is your Trash empty now? I should hope so! If you’ve gone through all of the steps above with no success, you may be the victim of a peculiar case that cannot be solved with common techniques and tools. Feel free to describe the problems you’re having in detail in the comments below. Perhaps someone from the helpful Mac community might be able to assist you.

114 Comments Have Been Posted (Leave Your Response)

After all … nop trash is NOT empty. Very agonizing …

I have even reset the OS-X tried all and above but there is still a folder with the file in it which is resisting to go …

My issue is that folders I am trying to delete are NOT in the trash. They are actually on a different computer and I am trying to delete remotely. When i use “Move to Trash”, I get the “immediate delete” confirmation dialog. But every attempt to delete, I get a “file in use” error, before the process can finish.

These are actually “grayed out” folders, meaning they cannot be opened. They were the results of failed earlier attempts to copy this same folder over. Hoping I can delete these from the computer on which they reside. Hoping main issue is that I am trying to delete them through the network. If I work from the remote computer, hoping the move to trash will work normally. And, after that, either I can try to use TrashIt app or I will discover I can empty trash normally.

BTW, says 101 comments have been posted; but only see TWO – one of which is mine!

WHERE ARE THE OTHER 99 COMMENTS???

Yes. What worked was physically going to the computer with the incompletely copied folders. When I tried to delete from there, they deleted instantly and without issue! So obviously my problem was trying to delete these incomplete folders through the network.

YAY! The Terminal last chance procedure worked! Genius Rules! Thank you. xox

It did not work for me. My Trash folder has some items that were left over from a Mac OS Beta try out. I put them in the trash with the circle no symbol on them and there they sit ever since. I have tried everything here and several other places to no avail. Refuse to erase my hard drive and reinstall-have enough trouble with it right now with the trash.
Oh and the items that are in the trash are OS necessary items.

Have slightly different problem File will move to trash (apparently). It can them disappear when trash is emptied…. But the same file or folder will then come back to the place where I deleted it. Overall – cannot get rid of the file. ??

Tried restarting and delete immediately but still have this file coming up in my trash when hard drive is plugged in. When I click empty trash four pop ups come up, one saying the file can’t be deleted due to ‘system integrity protection’ and the others about some files that are still in use :/

I am deleting email off my iMac, the computer is very slow, I thought the trash can was full, I was going to empty it, to my surprise there was nothing in the trash, where are all my deleted items going, they are back ing up somewhere, the computer is almost at a stand still, terribly slow. Has anyone else had this problem, and how can I fix it. Please help

I tried everything and even though the file names were common without any unusual characters I renamed them and poof the trash emptied. Thanks a bunch.

When did the artwork change on the trashcan? In OsX 10.4 Tiger when you emptied the trash the wastebasket icon looks empty. On Mavericks the trash gets emptied but the icon still shows items filling the wastebasket… full, not the oldstyle really empty trash, where you can see the baskets wires on the otherside. Just a FYI>

I can’t empty the trash because it has a folder it won’t delete.

Error:

The Finder can’t complete the operation because some data in “sLMAbaLByfdHGLW” can’t be read or written.

(Error code -36)

(sLMAbaLByfdHGLW is the name of the folder I can’t delete. Weirdly, the name keeps changing on its own to different gibberish. I didn’t rename. After several attempts, the folder name changes by itself in the Trash bin.)

When I put the folder on the desktop, Trash is empty. But when I put back in the Trash, I can’t empty trash.

I’ve tried the following:

Secure Empty Trash

Rename the folder

TrashIt (software)

Cocktail (software)

Terminal (tried all the following commands):

rm -f ~/.Trash/*

Result:

rm: /Users/angelnieves/.Trash/sLMAbaLByfdHGLW: is a directory
(But Trash won’t empty)

With the folder on the desktop, typed on Terminal:

sudo rm -rf (space plus dragged in folder for path)
Result:
rm: /Users/angel/Desktop/sLMAbaLByfdHGLW: Input/output error

sudo rm -ri ~/.Trash
Result:
examine files in directory /Users/angelnieves/.Trash?
(But nothing happens.)

Also tried Repair Disk and Repair Permission, plus Terminal command:

sudo rm -rf ~/.Trash/
Result:
rm: /Users/angel/.Trash//PmXO7MHCrMmGn4: Input/output error
rm: /Users/angel/.Trash/: Directory not empty

Please help. Thanks.

I have system files in the Trash from an old Carbon Copy Cloner (CCC) backup. None of these methods work. After failing to clear each of thousands of files, Terminal notes ‘Operation not permitted’.

These files have a special (undocumented?) flag that prevents anyone (except CCC) from changing them in any way. Sierra thinks they are in use. Does anyone have suggestions?

I have the same issue as Tom (Feb 11, 2018) except my app was Time Machine. Trying to dump the backups to initialize that drive and nothing here (or anything else I’ve found) works.

I’ve tried doing a get info and unloacking the files lthat are locked and when reopening they’re locked again. Have tried restarting blah blah blah – nothing.

H E L P!

R.Cates