Unable to empty the trash in Mac OS X

Ok, so we use Surrond for source control at work (I know I know, it sucks but I didn’t pick it). Well, I checked out some files and then ended up deleting them all. Well, sort of. I moved them to the trash. Tonight I decided it was time to empty the trash (it was up to over 2GB). Lo and behold the Mac wouldn’t let me empty the trash. Why? Because some files were locked. So, I opened the trash, selected all of the items and opened the info (command-I). I then tried to unlock everything. It failed.

The next thing I tried was to go into my trash and do it from the terminal. Your trash is located in “/Users/username/.Trash/” . There, I tried to recursively set the permissions again (“chmod -R 700 *”). That failed because I lacked permissions. So, I tried using “sudo chmod -R 700 *” and was rejected again.

So, I went to Mac’s website and they recommended that I use the command “chflags -R nouchg ” and then list all of the file names I wanted to modify the permissions on. As it turns out, you can open the finder and drag files into your terminal window and it will automagically add them to the command line (very nifty). Anyway, I go rejected by that as well.

So I went back to Mac’s help page. As it turns out, you can hold down “command-option” while emptying the trash and it ended up deleting everything for me.

So why is ths so absurd to me? Because, how can the OS let me delete those files by holding down two characters while emptying the trash if I cannot modify the properties on those files using sudo? How can you have any file on your filesystem that you cannot modify with sudo? Seems like an OS bug to me.

Leave a Reply