Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Cannot empty trash because item is in use System
Sometimes it is not possible to empty the trash because an item is in use. There are many possible causes for this; here is one thing to try to eliminate the error.
  • Go to Finder and select Finder » Secure Empty Trash.
  • If this operation gets stuck, open the Activity Monitor utility and force quit the Locum process.
    Enter your admin password when requested.
  • Go back to Finder and select Finder » Empty Trash.
This fixed it for me.

[crarko adds: I found this thread in the MacOSXHints forums where the Locum process is discussed. It references a good source for finding out more information about this process. By the way, the word 'Locum' means 'place-holder' or perhaps 'temporary proxy' is more applicable in this case. Apparently it fills in for the Finder in the background while emptying the Trash. It also can consume quite a bit of memory while doing so with a large number of files.]
    •    
  • Currently 4.00 / 5
  You rated: 5 / 5 (6 votes cast)
 
[113,781 views]  

Cannot empty trash because item is in use | 19 comments | Create New Account
Click here to return to the 'Cannot empty trash because item is in use' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Command line can help too
Authored by: prichardson on Jan 20, '11 07:51:42AM
My foolproof method has always been with rm. Open your Terminal and type:

cd ~/.Trash
rm -r *
As always, be careful with rm.

[ Reply to This | # ]
Cannot empty trash because item is in use
Authored by: kevans on Jan 20, '11 08:08:59AM

My problem is that frequently the file said to be in use is NOT in use, and the related app is closed. Secure empty trash works in this case. Why does the sys think such files are still in use?



[ Reply to This | # ]
Cannot empty trash because item is in use
Authored by: joeyblades on Jan 20, '11 08:26:19AM

Of course, first make sure that the file is not actually in use by an application.

Perhaps force quitting the Locum process is more elegant, but my solution has always been to open a terminal window and delete the file directly (i.e. type 'rm ' in the terminal window and drag the file in question to the terminal window, then hit return. However, this may leave the Locum process hanging... I haven't checked.



[ Reply to This | # ]
Cannot empty trash because item is in use
Authored by: CHM on Jan 20, '11 08:28:16AM

For me, this problem occurs with any file I mail as an attachment with Mail.app. It's been this way since 10.6.0 and I've filed a bug with Apple (as have many according to the Apple discussion forums) but it's still an issues. Overall, just kind of annoying but I wish they'd fix it!

One more thing: if you have a LOT of items in your trash that take up a lot of disk space, it's best to use a regular "empty trash" first and tell it to continue when you get the error about not being able to remove certain items. Then follow up with the secure-empty trash. Otherwise it can take a long time to securely erase all those files.



[ Reply to This | # ]
Cannot empty trash because item is in use
Authored by: alansky on Jan 20, '11 01:18:47PM

My solution to Mail attachments that cannot be deleted from the Trash is simply to quit and relaunch the Mail app. Takes 2-3 seconds and works every time.



[ Reply to This | # ]
Cannot empty trash because item is in use
Authored by: Quatch on Jan 20, '11 08:48:25AM

Will doing this invoke the secure delete bug where the temporary file is left in place and forgotten? (thus taking up disk space forever/manually deleted)



[ Reply to This | # ]
Cannot empty trash because item is in use
Authored by: bloodnok on Jan 20, '11 09:22:21AM

if you know the file that can't be trashed is harmless, just

cd ~/.Trash; rm -rf *

handle with care, though.



[ Reply to This | # ]
Cannot empty trash because item is in use
Authored by: dbingham on Jan 20, '11 10:50:43AM
Bad. Bad shell scriptor!

What if I made a typo in the directory name? The way you wrote the command, you run a VERY real risk of deleting everything in your home directory. Which, presumably isn't something you want to have to recover from.

Much, MUCH better would be:
$ cd ~/.Trash && rm -rf *

I know you said "handle with care", but such a simple modification makes it MUCH safer.

Remember friends, when one command depends on the successful completion of another command && is what you want. Not ;.

[ Reply to This | # ]
Cannot empty trash because item is in use
Authored by: marshaul on Aug 22, '13 12:06:39PM
What's the point of CDing in the first place? Why not:

rm -rf ~/.Trash

There's no point to changing to that directory if you only wish to perform a single action in that directory.

Even better:

rm -rf ~/.Trash; rm -rf /Volumes/*/.Trashes

[ Reply to This | # ]
Cannot empty trash because item is in use
Authored by: Doc Drang on Jan 20, '11 11:17:08AM
A while ago I wrote a little script to tell me which process was holding onto a file and preventing me from emptying the Trash. It's not much, just 2 lines of bash, but it's been helpful.
#!/bin/bash
echo "Looking..."
lsof | grep Trash


[ Reply to This | # ]
Cannot empty trash because item is in use
Authored by: CHM on Jan 20, '11 11:37:47AM

That is quite useful, thanks.

Something interesting about that: After mailing an attachment, then trashing the document I had attached, I got the expected file in use error. So I tried the lsof | grep -i busy command you pointed out and came up with nothing. Very peculiar this mail attachment bug...



[ Reply to This | # ]
Cannot empty trash because item is in use
Authored by: ventifact on Jan 20, '11 07:03:22PM

If Shift + Option + Command + Delete won't empty everything I Option click the Finder App in the Dock and choose Relaunch.

---
OSX 10.4.11, 20" 1.8GH iMac—It just won't die.



[ Reply to This | # ]
Cannot empty trash because item is in use
Authored by: joeyblades on Jan 21, '11 07:52:22AM

Slightly off topic, but I feel compelled to point out what I think is bad advice in general. I've been using unix since the late 70's. I'm reasonably savvy with unix, yet I almost never use rm * to delete files. The only time I ever do this is after I double and triple check that I'm in the right directory and I list the files that I'm about to nuke as an alternate check that the destruction I am about to wreak is the destruction I intend. I would never recommend the use of this command to anyone because I can never be sure that they are as careful as I am.

In the case of this example, it's like using a chainsaw to remove a wart. It's simply not necessary. All you have to do is open a terminal window and type rm followed by a space, open your trash and drag the file you want to remove to the terminal window, then hit return. It's easy. It's safe. It's effective. It's actually quicker than doing the cd to your Trash folder in the terminal.

Sorry, climbing down from my soapbox now.



[ Reply to This | # ]
Cannot empty trash because item is in use
Authored by: dzurn on Jan 21, '11 10:47:35AM
I agree, the rm command should almost never get * in normal usage, it's just too risky, even when we think we know what we're doing.

I always add the -i flag ("interactive") when issuing rm -rfi so the system asks before deleting every file.

---
Madness takes its toll.
Please have exact change.


[ Reply to This | # ]
Cannot empty trash because item is in use
Authored by: asmeurer on Jan 21, '11 01:27:28PM
Another option would be to use the lsof command and try to close whatever is using the file. Something like lsof | grep Trash.

[ Reply to This | # ]
Cannot empty trash because item is in use
Authored by: teacy123 on Jan 23, '11 05:12:12AM

I found that the main reason in my use was the calculation of thumbnails (e.g. Flip4Mac calculating a thumbnail for a large WMV file in the trash).
Not looking at the trash but using the "Empty Trash" context menu on the Dock prevents most occurrences for me.



[ Reply to This | # ]
Cannot empty trash because item is in use
Authored by: mangobot on Apr 23, '12 08:14:16AM

hello,

very annoying this, BUT i found a good working solution here:
http://thexlab.com/faqs/trash.html

Force the Trash to empty using the Option key

This technique uses a hidden feature of Mac OS X to force the Trash to empty. Perform the following steps in the order specified:

Press and hold the mouse button on the Trash icon in the Dock. The context menu for Trash will display.
Press and hold the Option key or the Shift-Option keyboard combination,
Select Empty Trash from the context menu for Trash.
Release the keys pressed and held in step 2.

it actually works (mac osx lion)
good luck



[ Reply to This | # ]
Cannot empty trash because item is in use
Authored by: zero216ca on May 23, '13 05:02:19PM

Sorry to bump this old thread, but I was trying to take the advice posted here, and entered cd
~/.Trash
rm -r *

as two separate lines....now everything in my documents, downloads, desktop, and some other things are gone. Is there any way to undo this!? I'm freaking out, I have some important stuff that is not backed up (stupid, I know).



[ Reply to This | # ]
Cannot empty trash because item is in use
Authored by: vykor on May 24, '13 08:47:42AM

There is another minor caveat with the rm-based alternative. If you rm a file while it is in actual use, you will most likely not get the disk space back until that file is released by whatever is holding an open file descriptor to it. The file will disappear from the Trash and directory listings, so if you just like to see an empty Trash icon, then ok. If you actually want the disk space marked as free for other uses, this is usually not enough.

For large files, more comprehensive (though time consuming) solution is to use lsof | grep <filename> to check what process is holding the file open, and then killing that process. This way you can use empty trash from the GUI and guarantee yourself the disk space back.



[ Reply to This | # ]