Can't remove files from Trash

OK I have a new iMac, and I deleted some files from my iCloud Drive, but now I can't remove them from my trash folder.


I've tried everything I can possibly thing of... I've tried an "immediate delete", emptying the Trash in safe mode, I've changed permissions and removed the lock flag in terminal and tried to do an "rm -rf /folder", I've tried the terminal in recovery mode.


It says permission denied in the terminal, but when I try to empty the trash within the UI it tells me the files are in use. I have no idea what by, though... I've tried an lsof search on some of the files and it comes back with no response, suggesting that nothing is holding the files open. I've also tried shutting down every application I can think of.


My only thought is that because I deleted the files from my iCloud Drive it's somehow retaining an active link back to the original location, but again... safe mode didn't help.


It's driving me out of my mind, so any new suggestions greatly appreciated.

iMac 24″, macOS 15.3

Posted on Feb 7, 2025 11:51 AM

Reply
Question marked as Top-ranking reply

Posted on Feb 7, 2025 1:07 PM

Try removing them from iCloud Drive by signing in to its web interface, here: https://www.icloud.com/iclouddrive/


It has its own "Recently Deleted" folder.


Let us know if that works, if not I may have other ideas.

Similar questions

11 replies

Feb 7, 2025 12:19 PM in response to DayleJames

When you attempt to empty the Trash, and you get the "file in use" error message, you can use the lsof command in the Terminal to try to figure out what is causing this.


You mentioned in your post that you already tried this command, but did you try it this way?

  • lsof +D ~/.Trash


This command should list all open files inside the Trash directory, and in addition, show which process(es) is/are using them. You can also run that command with sudo to gain access to more details.


Then once you find the process, lsof will also provide that process' PID. You can then stop that process with the kill command.

Feb 8, 2025 4:41 AM in response to DayleJames

Try signing out of iCloud, and signing back in again. It's the iCloud equivalent of "turning it off and on again". Upon signing out, you will be asked if you want to retain copies on the local Mac. I don't think it will matter which option you choose, so try it both ways.


Back up your Mac before doing anything, which just goes without saying.


That's all I can think of for now.

Feb 7, 2025 12:32 PM in response to DayleJames

Hmm, it may be possible that the sync process between your Mac and the iCloud Drive has not fully completed yet.


I'm "scratching my head" to see if that will help me come up with anything else to offer. In the mean time, you can wait for someone else to reply, or go ahead, and contact Apple Support directly for further assistance with this issue.

Feb 7, 2025 12:40 PM in response to Tesserax

Thanks


It's actually possible that the sync process between my computer and iCloud was interrupted.

I certainly did check. It was a big folder (about 5GB), that I copied to iCloud, and then tried to delete.


If that's an issue though, I would have expected a reboot or safe mode to solve it.


I just tried removing the files within the recovery console again, but I can't find my home folder. When I reboot into the recovery console and open the terminal I navigate to the "Users" folder but there is no home folder in there. I do not know why.


I wonder whether, if I can solve that problem, I can delete the files from within that recovery terminal?

Feb 8, 2025 12:04 PM in response to John Galt

OK so I've made progress.


It occurred to me that I might be able to restore it, so I moved it back out of the trash folder onto my Mac hard disk. That worked fine, but I still can't delete it from my hard drive. Same problem.


So I tried to move it to my external disk, and I got an error saying "the operation can't be completed because needs to be downloaded". This seemed a lot like the system still thinks it's downloading/syncing from iCloud.


So, I took your advice and logged out of iCloud on this Mac, but it STILL couldn't be deleted from my local hard disk. Permission denied or "in use" messages when I try.


There must be some way to disconnect the files on the disk from the sync process that has them locked.


I'm out of ideas, though. I'll try to talk to Apple support when I have more time.


Thanks. :)

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Can't remove files from Trash

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