I was trying to remove a folder at /var/empty with no success (Operation not permitted):
ls -al dr-xr-xr-x 2 root wheel 512B Jul 18 2010 empty
sudo rm -Rf empty rm: /var/empty: Operation not permitted
So I decided to change the permission:
sudo chmod a+rw empty/
and it did not work either:
chmod: empty/: Operation not permitted
Finally, I gave chflags a try:
chflags -R noschg empty/ sudo rm -Rf empty/
Done!
–Derrick
Our sponsors:
Twelve years later and your post still helps people. Thanks!