Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
share|improve this question

marked as duplicate by Gilles, 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.

share|improve this answer
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.