0

I am trying to delete files from trash on my MacBook. I have tried to remove with:

sudo rm -rf /.Trash ~/.Trash

Can not remove all files from Trash in OS X

But I get Operation not permitted error

Any help is appreciated.

NathanGL
  • 101
  • 2
  • What you are trying to do is empty at the same time your own Trash / Recycle Bin and the system's. Some items may have been marked for deletion pending a reboot by the OS, but they will be deleted at its discretion, not yours. What happens if you just try a "sudo rm -rf ~/.Trash"? –  Jun 11 '20 at 11:23
  • @Didier Still the same ```rm: /Users/Admin/.Trash/2e4/SafariFamily: Operation not permitted rm: /Users/Admin/.Trash/2e4/com.apple.Safari/SafariFamily: Operation not permitted rm: /Users/Admin/.Trash/2e4/com.apple.Safari: Directory not empty rm: /Users/Admin/.Trash/2e4/SafariFamily: Operation not permitted rm: /Users/Admin/.Trash/2e4/com.apple.Safari/SafariFamily: Operation not permitted rm: /Users/Admin/.Trash/2e4/com.apple.Safari: Directory not empty ``` – NathanGL Jun 11 '20 at 11:37
  • OK, this explains that: you're trying to permanently delete a file related to a preinstalled application (Safari). macOS won't allow that, not even in Recovery Mode, unless you disable System Integrity Protection first (sudo csrutil disable), reboot in normal mode, and use the commands you've already used in Terminal. Is there a reason why you tried to uninstall Safari in the first place? –  Jun 11 '20 at 13:38
  • Thanks, @Didier turned off System Integrity Protection and can delete it now. Well, I couldn't uninstall Safari so I tried removing it totally and that happened. It simply didn't work for me. – NathanGL Jun 11 '20 at 19:54
  • You're not supposed to uninstall Safari. It's part of macOS, same Internet Explorer is/was part of Windows. Only way to totally and cleanly uninstall it is via a third-party like AppCleaner, but it's not recommended at all. Glad you solved your problem, though. –  Jun 11 '20 at 22:02

0 Answers0