MacOS – “Directory not empty” sudo rm -r -i “file name” not working

deletingmacostrash

I tried moving some backup files to my trash so that I could free up some space on the backup drive. Using Finder, I was able to empty the trash can with the exception of one directory that remains even though emptying trash raises no error messages.

After searching around I found quite a few examples for forcing the trash can to empty. However I've tried several now and I'm getting the same message.

The directory looks like this:

Domain Users  102 Jan  6 10:35 .
Domain Users  102 Jan  6 10:35 ..
Domain Users  102 Jan  6 10:35 Local Storage

I ran this command to delete that Local Storage folder:

$ sudo rm -r -i Local\ Storage/

And this is the message I get:

rm: Local Storage/: Directory not empty

I also changed the permissions so that I own the folder but that didn't help.

This is the directory I'm working in:

/Volumes/BackUpDrive/.Trashes/862998330/2013-11-26-143907/Macintosh HD/Users/{user}/Library/Application Support/Google/Chrome/Profile 1

I also tried deleting the entire "862998330" folder but that didn't work either so I moved onto deleting each directory and that's where I am now.

Machine stats:

• 27-inch, Mid 2011

• OSX 10.91

Best Answer

First, I would be sure no files are locked

sudo chflags -R nouchg Local\ Storage

Then, assuming you are sure about using sudo and rm -rf on your backup drive, you could tell rm to force things.

sudo rm -rf -i Local\ Storage