Want to highlight a helpful answer? Upvote!

Did someone help you, or did an answer or User Tip resolve your issue? Upvote by selecting the upvote arrow. Your feedback helps others! Learn more about when to upvote >

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Can't empty trash in El Capitan

Hi there!


I deleted one user account from my MacBook. That went fine. But the procedure left some folders to my drive. I moved them to the trash. When I try to empty the trash, I get the following error codes: "The operation can't be completed because an unexpected error occurred (error code -50)" and "The operation can't be completed because the item "ITEM NAME" is in use". Just run DiskWarrior 5 from external drive, and my internal drive Macintosh HD should be ok.


But in practise I have now 20 empty folders in my trash and I cannot delete them. Otherwise the computer is working normally. But because of that every time I want to empty my trash, I need to click the mouse 20 time extra! Doh... The size of every folder is 0K.


I have been talking with Apple Support and tried several console tricks, no help. Their last advice was to manually copy every file I need to external disk and then format the whole Macintosh HD and re-install the OS. I wouldn't want to go that far, if there's still something more I could try before that. Any suggestions?

MacBook Pro with Retina display, OS X El Capitan (10.11.2)

Posted on Jan 25, 2016 8:19 AM

Reply
Question marked as Best reply

Posted on Jan 25, 2016 1:13 PM

Please open the Trash and select the items that you can't delete. Right-click or control-click. From the popup menu, select

Delete immediately...

Confirm when prompted.

22 replies

Jan 27, 2016 4:19 AM in response to Luis Sequeira1

Hi Luis,


Thank you for you reply. Yes I have restarted my computer. I've had this problem since November.

So far I have tried with Apple support the following commands in console:


1. cd ~/

2. rm -R .Trash


1. cd /Users/[usersHome]

2. sudo rm -R .Trash


1.sudo rm -ri ~/.Trash


1. "sudo rm -rf "


1. sudo chflags -R nouchg ~

2. sudo chmod -RN ~

3. diskutil resetUserPermissions / `id -u`


1. ls -laeO ~/.Trash

2. ls -laeO ~/.Trash/"username"\ 18.59.26


1. sudo rm -rf /Users/"username"/.Trash/

2. sudo rm -rf ~/.Trash/*

Jan 27, 2016 5:24 AM in response to soundefilm

deletion console commands could override the OS's safeguards on the prevention of deleting necessary system files if they were placed in the trash accidentally or otherwise. I'm curious as to why Apple would suggest it when in the past frequent users here would berate select members who suggested it for any reason.


disconnect all external drives and reboot with them disconnected. Empty trash from Finder>Empty Trash

if the trash appears empty reconnect the external drives and reboot again

Jan 27, 2016 5:35 AM in response to soundefilm

soundefilm wrote:


Hi Luis,


Thank you for you reply. Yes I have restarted my computer. I've had this problem since November.

So far I have tried with Apple support the following commands in console:


1. cd ~/

2. rm -R .Trash


1. cd /Users/[usersHome]

2. sudo rm -R .Trash


1.sudo rm -ri ~/.Trash


1. "sudo rm -rf "


1. sudo chflags -R nouchg ~

2. sudo chmod -RN ~

3. diskutil resetUserPermissions / `id -u`


1. ls -laeO ~/.Trash

2. ls -laeO ~/.Trash/"username"\ 18.59.26


1. sudo rm -rf /Users/"username"/.Trash/

2. sudo rm -rf ~/.Trash/*


This is the kind of Terminal commands I had in mind.

I suppose that they didn't work either. Did you get an error? Can you tells what error exactly?


Also, from Jimmy's comment about necessary files: what are the names of those folders that refuse to go? Do they look like anything that may be perceived as system things rather than a user's?

Jan 27, 2016 8:46 AM in response to Luis Sequeira1

Hi,


Yes, the terminal commands I tried didn't help.

I saved a couple terminal outputs:


Terminal output 1:


Last login: Tue Dec 8 17:33:57 on console

MacBook-Pro-3:~ jakoskin$ sudo rm -rf /Users/jakoskin/.Trash/pietari\ 18.59.26

Password:

Sorry, try again.

Password:

rm: /Users/jakoskin/.Trash/pietari 18.59.26/Documents/työkoneelta/Pietarin työt/␀␀␀␀HFS+ Private Data: Invalid argument

rm: /Users/jakoskin/.Trash/pietari 18.59.26/Documents/työkoneelta/Pietarin työt: Directory not empty

rm: /Users/jakoskin/.Trash/pietari 18.59.26/Documents/työkoneelta: Directory not empty

rm: /Users/jakoskin/.Trash/pietari 18.59.26/Documents: Directory not empty

rm: /Users/jakoskin/.Trash/pietari 18.59.26: Directory not empty

MacBook-Pro-3:~ jakoskin$


Terminal output 2:

Last login: Thu Dec 10 11:15:30 on ttys000

MacBook-Pro-3:~ jakoskin$ sudo chflags -R nouchg ~

sudo chmod -RN ~

diskutil resetUserPermissions / `id -u`

MacBook-Pro-3:~ jakoskin$ sudo chmod -RN ~

MacBook-Pro-3:~ jakoskin$ diskutil resetUserPermissions / `id -u`

Ready to reset user permissions on disk1 Macintosh HD

Started verify/repair permissions on disk1 Macintosh HD

User permissions have been reset

Finished verify/repair permissions on disk1 Macintosh HD

MacBook-Pro-3:~ jakoskin$ ls -laeO ~/.Trash

total 0

drwxr-xr-x 6 jakoskin staff - 204 Dec 10 11:22 .

drwxr-xr-x@ 41 jakoskin staff - 1394 Dec 8 11:47 ..

0: group:everyone deny delete

drwxr-xr-x@ 3 jakoskin staff - 102 Dec 9 10:11 pietari

drwxr-xr-x@ 3 jakoskin staff - 102 Dec 9 10:11 pietari 18.58.49

drwxr-xr-x@ 3 jakoskin staff - 102 Dec 9 10:12 pietari 18.58.49 18.59.28

drwxr-xr-x@ 3 jakoskin staff - 102 Dec 9 10:08 pietari 18.59.26

MacBook-Pro-3:~ jakoskin$ ls -laeO ~/.Trash/pietari\ 18.59.26

total 0

drwxr-xr-x@ 3 jakoskin staff - 102 Dec 9 10:08 .

drwxr-xr-x 6 jakoskin staff - 204 Dec 10 11:22 ..

drwxr-xr-x@ 3 jakoskin staff - 102 Dec 5 13:22 Documents

MacBook-Pro-3:~ jakoskin$


About the names of the folder(s), I have changed their names while the have been in trash.


This begin when I deleted one user account from my MBP. It went successfully (no error codes etc.), but after the process I noticed that in the folder Users there was still one folder from the deleted account (I noticed later that inside that folder was another folder etc.). I moved it to trash but wasn't able to empty the it (got those error codes). Then I tried to move that folder out from trash to desktop, but instead of moving the folder Finder made a copy of it to desktop. I moved that back to trash and voilà - I had two orders in trash i couldn't delete.


Below is a a link to screenshot of my trash, as it is now. Strange that many of them look like the have been modified today. I haven't touched them. Thank you for your help!

https://www.flickr.com/photos/14379179@N08/24022012963/in/datetaken/

Jan 28, 2016 7:06 AM in response to soundefilm

Please start up in Recovery mode, launch Disk Utility, select the startup volume ("Macintosh HD," unless you gave it a different name), and run First Aid. If any problems are found, repeat. Then restart as usual.

If you don't already have a current backup, you must back up your data before you take the above step. You may be able to back up, even if the system isn't fully functional. Ask if you need guidance.

Jan 28, 2016 7:20 AM in response to Luis Sequeira1

In a possible moment of ignorance that may have gotten the better of my good will I posted this solution to a user some time ago with this identical problem and evoked an scathing rebuke from a frequent member of this community for potentially destroying core features of the OS with those terminal commands. So I'm trying to find a nice way to reiterating what I was singled out for in a polite way. My apologies if you thought it was an attack on your and your methodologies which in the past I have found to be insightful and helpful to many issues.

Jan 28, 2016 9:57 AM in response to soundefilm

You need at least two complete, independent backups to carry out this procedure. One is not enough to be safe. Ask if you need guidance.

Start up in Recovery mode. When the OS X Utilities screen appears, select Disk Utility.

In the Disk Utility window, select the icon of the startup volume from the list on the left. If you use FileVault, it will be nested below another disk icon. Select Unlock from the File menu. When prompted, enter the login password of a user authorized to unlock the volume, or the alternate decryption key that was generated when you activated FileVault.

Select the Erase tab, and then select

Mac OS Extended (Journaled)

from the Format menu.

You can then quit to be returned to the main Recovery screen. Follow these instructions if you back up with Time Machine. If you use other backup software, follow its developer's instructions.

Can't empty trash in El Capitan

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.