This question already has an answer here:

I've been experimenting with file permissions and ownership lately, and I tried this:

touch a
sudo chown root:root a
sudo chmod 000 a

I can't read, write, or execute the file, but I can still delete it using -f. Why is this? I don't own the file, and nobody has any permission for the file. Shouldn't you need root to delete a 000 file you don't own?

---------- 1 root  root      0 Apr  3 20:18 a

marked as duplicate by Gilles 'SO- stop being evil', vonbrand, jasonwryan, jordanm, manatwork Apr 4 '13 at 5:45

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.


What you call "delete a file" is really just deleting a reference to the file in a directory , and the right to do so is the right to modify the directory; the file permissions play no part in this. If that was the last reference to the file, the file is destroyed, but that is a separate issue.

  • What do file permissions change, then? Does this mean you couldn't srm it? – tkbx Apr 4 '13 at 0:42

Not the answer you're looking for? Browse other questions tagged or ask your own question.