6

I have no idea how two files ended up in Trash, but I suspect AppDelete to be the culprit. Anyway, the first file is DeviceLink.framework and the other is MobileDevice.framework.

Any idea how to remove them from trash so I can finally be able to empty it?

10

Shutdown your laptop.
Press Command + R and then the power button to boot into recovery mode.
Click the Utilities menu and select Terminal.
Type csrutil disable and press return.
Close the Terminal app and restart out of recovery mode.

Login to your machine normally and launch the Terminal app on your Mac by either searching for it in Spotlight or locating it in the Utilities folder under Applications.
In Terminal enter this command sudo rm -rf ~/.Trash/* it'll ask for your login password. That should clear your trash.

If that worked re-enable SIP.
Shutdown your laptop.
Press Command + R and then the power button to boot into recovery mode.
Click the Utilities menu and select Terminal.
Type csrutil enable and press return.
Close the Terminal app and restart out of recovery mode.

  • 1
    FYI, after disabling CIP and restarting normally, I was able to empty the trash from the Finder, without resorting to the command line. It did ask if I wanted to delete locked files. – Zac Imboden May 26 '17 at 22:48
1

In my case, I had an old backup of my old boot disk and I deleted all files in it. But, some files got stuck and will never go away.

Please note that I have a separate boot disk now and its safe to delete stubborn files from old disk. Please do not try until you know what you are doing.

For me this worked:

Open Terminal

cd /Volumes
ls -la

Check the old boot drive mount point.

cd old_boot_drive
cd .Trashes
sudo ls -la

You will not see your files, but you will see a folder, in my case it was 501.

cd 501
sudo ls -la

Now, you will see the list of all stubborn files in the Trash. Delete them one by one.

sudo rm -rf file1
sudo rm -rf folder2

To delete files OR folders with blank spaces or special characters in them. Please use double quotes.

sudo rm -rf "folder with blanks"

As soon as all files are deleted you will see that Trash icon on your Mac will appear blank now.

Hope it helps someone.

  • Perfect, and no need to mess with SIP. – Matt Sephton Oct 4 '17 at 17:18

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .