How many times you have encountered this message while trying to empty your trash on your Mac :
“This operation cannot be completed because the item filename.ext is in use”
and you would go crazy trying to delete it but it wouldn’t unless you restart your system.
One way to empty trash in this case is:
1) Drag the file from your Trash bin back to the Desktop.
2) Launch a Terminal i.e Go to Application -> Utilities -> Terminal and type the following into the terminal window leaving a space after -rf
cd ~/.Trash && sudo rm -rf
3) Drag that file you wanted to delete from your Desktop to the terminal window and then press Enter.
4) It will ask for your Mac password, so enter your password and press Enter. (Note: On terminal window, when you type the password, you won’t be able to see it, but the password is being entered. So don’t panic).
If you followed the steps correctly, then the trash will be emptied.

Keith
05 / 10 / 2009
Actually if you read the message displayed, it says you can empty the trash can by holding the option key down when you right-click the icon
Nischal Maniar
06 / 01 / 2009
I agree to that, but what you are talking about is the case when you have an application open and you want to delete a file. Say e.g. a mp3 file you have your music player open and you still want to delete that mp3 file. Then you can do it by holding Option key and right click.
But sometimes, even if you shut down all apps, you still cannot delete the file, thats when the method mentioned in the post can be applied.
Madi
07 / 18 / 2009
thank you! this worked perfectly.
Kelly Rodgers
07 / 23 / 2009
Hi, I found your assist thru. Google search…
Thanks so much!
I did everything you explained to the “T” but ran into another snag:
Basically 6 .cab files from an older laptop I’d transferred over to my Mac about 3 years ago… I don’t know how to unlock them and using your suggestion ALMOST worked but still got “locked, unable to delete in Terminal
PS: I have tried numerous times to do the other suggestion of pressing option key/right click, etc. but nothing pops up to give me the option to delete locked files… is it that I must hold down those keys for the entire time?
I currently have 559,000 old files sitting in my Trashbin and cannot delete them because data1.cab is blocking the rest of the deletion process….
Please, do you have another suggestion?
I’m self-taught on Mac so I appreciate any advice from users such as yourself who have a lot more knowledge in this area…
Kelly
Macintosh-5:.Trash kellyrodgers$ data1.cab
-bash: data1.cab: command not found
Macintosh-5:.Trash kellyrodgers$ /Users/kellyrodgers/Desktop/data1.cab\ locked\ unable\ to\ delete/data1\ 10.cab /Users/kellyrodgers/Desktop/data1.cab\ locked\ unable\ to\ delete/data1\ 11.cab /Users/kellyrodgers/Desktop/data1.cab\ locked\ unable\ to\ delete/data1\ 12.cab /Users/kellyrodgers/Desktop/data1.cab\ locked\ unable\ to\ delete/data1\ 13.cab /Users/kellyrodgers/Desktop/data1.cab\ locked\ unable\ to\ delete/data1\ 14.cab /Users/kellyrodgers/Desktop/data1.cab\ locked\ unable\ to\ delete/data1\ 16.cab /Users/kellyrodgers/Desktop/data1.cab\ locked\ unable\ to\ delete/data1\ 17.cab /Users/kellyrodgers/Desktop/data1.cab\ locked\ unable\ to\ delete/data1\ 2.cab /Users/kellyrodgers/Desktop/data1.cab\ locked\ unable\ to\ delete/data1\ 3.cab /Users/kellyrodgers/Desktop/data1.cab\ locked\ unable\ to\ delete/data1\ 4.cab /Users/kellyrodgers/Desktop/data1.cab\ locked\ unable\ to\ delete/data1\ 5.cab /Users/kellyrodgers/Desktop/data1.cab\ locked\ unable\ to\ delete/data1\ 6.cab /Users/kellyrodgers/Desktop/data1.cab\ locked\ unable\ to\ delete/data1\ 7.cab /Users/kellyrodgers/Desktop/data1.cab\ locked\ unable\ to\ delete/data1\ 8.cab /Users/kellyrodgers/Desktop/data1.cab\ locked\ unable\ to\ delete/data1\ 9.cab /Users/kellyrodgers/Desktop/data1.cab\ locked\ unable\ to\ delete/data1.cab /Users/kellyrodgers/Desktop/data1.cab\ locked\ unable\ to\ delete/data1\ 15.cab
-bash: /Users/kellyrodgers/Desktop/data1.cab locked unable to delete/data1 10.cab: cannot execute binary file
Macintosh-5:.Trash kellyrodgers$
Macintosh-5:.Trash kellyrodgers$
Kelly Rodgers
07 / 23 / 2009
UPDATE
I solved it! Perseverance paid off in the end YAY 


But, didn’t find a link…
I had the files saved on my desktop as per your instructions above…(Thanks!)
I highlighted, one at a time, each data.cab file that was locked, then I right-clicked the file and clicked “get info.” in the column it shows the file “locked” with a check mark, I simply UNchecked it and it became UNlocked! Then I moved all now UNlocked files to my Trash bin and was able to delete everything
Thanks again for posting troubleshooting help to the general public. That’s your good deed for the day, every day
PS: was curious about your paintings, I’m also an artist so I take extra pleasure in viewing other work
Namaste!!! Kelly
EssieRoss18
03 / 11 / 2010
Some time ago, I did need to buy a building for my firm but I did not earn enough cash and couldn’t purchase something. Thank God my dude proposed to get the business loans at reliable creditors. So, I acted that and used to be satisfied with my car loan.
mary
08 / 16 / 2010
thank you…it worked….i was worried i will never be able to delete anything from the trash
Thanks