Deleting locked files

May 03, '01 07:16:39PM

Contributed by: Scott Byer

So, how many of you reboot into OS 9 just so you can empty the trash when you've got Finder Locked files in there?

How often does rm -rf fail on you with "Operation not permitted"?

You too can work around these problems with the terminal command:

chflags -R nouchg,noschg *

See the Man page for more info.

[Editor's note: I did this after doing a "cd ~/.Trash" in the terminal, to make sure I was in my trash folder. I haven't had the locked file problem, but for those that have, this could be a huge timesaver. If you'd like to see what it does first, put "echo " in front of the command.]

Comments (4)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20010503191639382