0

This question already has an answer here:

As a root user, I created a file in / directory. I can only read this file when logged in as normal user (say A) as expected.I changed the ownership to A.Now A can read as well as write.But when I try to delete it, permission denied message comes.Can anyone explain why?

marked as duplicate by Jeff Schaller, roaima, Stephen Kitt, Anthon, don_crissti May 26 '16 at 15: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.

  • 1
    Can you post the output of /usr/bin/stat /yourfile? That would reduce the amount of guess work. – joepd May 26 '16 at 15:14
  • @joepd see the link in Jeff's comment. It's got nothing to do with the files permissions :) – forquare May 26 '16 at 15:15
5

Deleting a file isn't a modification of the file, it's a modification of the directory containing the file. If you don't have the rights to modify the directory, you cannot remove the file within that directory.

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