Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

This question already has an answer here:

file name : abc

permissions : -rwxrwxrwx

shell : ksh

I am logged with the user which is the owner of this file.

Contents of file

AccessTime = 20130424-161120   ActualShmKeyDec = 1090650862   ActualShmKeyHex = 0x410202ee   Dev = 4457198   Inode = 64770   FtokShmKeyDec = 1090650862   FtokShmKeyHex = 0x410202ee   LastBootTime = 2013-04-24--11:41   UptimeMins = 4:30,-3--users   UptimeSecs = 16253.96
AccessTime = 20130424-170309   ActualShmKeyDec = 1090650862   ActualShmKeyHex = 0x410202ee   Dev = 4457198   Inode = 64770   FtokShmKeyDec = 1090650862   FtokShmKeyHex = 0x410202ee   LastBootTime = 2013-04-24--11:41   UptimeMins = 5:22,-3--users   UptimeSecs = 19362.82
AccessTime = 20130424-173741   ActualShmKeyDec = 1090650862   ActualShmKeyHex = 0x410202ee   Dev = 4457198   Inode = 64770   FtokShmKeyDec = 1090650862   FtokShmKeyHex = 0x410202ee   LastBootTime = 2013-04-24--11:41   UptimeMins = 5:57,-2--users   UptimeSecs = 21434.49
AccessTime = 20130424-180537   ActualShmKeyDec = 1090650862   ActualShmKeyHex = 0x410202ee   Dev = 4457198   Inode = 64770   FtokShmKeyDec = 1090650862   FtokShmKeyHex = 0x410202ee   LastBootTime = 2013-04-24--11:41   UptimeMins = 6:25,-1--users   UptimeSecs = 23111.03
AccessTime = 20130424-191315   ActualShmKeyDec = 1090650862   ActualShmKeyHex = 0x410202ee   Dev = 4457198   Inode = 64770   FtokShmKeyDec = 1090650862   FtokShmKeyHex = 0x410202ee   LastBootTime = 2013-04-24--11:41   UptimeMins = 7:32,-1--users   UptimeSecs = 27168.95
AccessTime = 20130425-101909   ActualShmKeyDec = 1090650862   ActualShmKeyHex = 0x410202ee   Dev = 4457198   Inode = 64770   FtokShmKeyDec = 1090650862   FtokShmKeyHex = 0x410202ee   LastBootTime = 2013-04-24--11:41   UptimeMins = 22:38,-2--users   UptimeSecs = 81522.99
AccessTime = 20130425-124617   ActualShmKeyDec = 1090650862   ActualShmKeyHex = 0x410202ee   Dev = 4457198   Inode = 64770   FtokShmKeyDec = 1090650862   FtokShmKeyHex = 0x410202ee   LastBootTime = 2013-04-24--11:41   UptimeMins = 1-day--1:05   UptimeSecs = 90350.71
AccessTime = 20130430-161311   ActualShmKeyDec = 1090650862   ActualShmKeyHex = 0x410202ee   Dev = 4457198   Inode = 64770   FtokShmKeyDec = 1090650862   FtokShmKeyHex = 0x410202ee   LastBootTime = 2013-04-28--06:01   UptimeMins = 2-days--10:12   UptimeSecs = 209527.13

Now when I try to delete this file..I get this error.

rm: cannot remove `abc': Permission denied

Any reason why I cannot remove this file ?

share|improve this question
add comment

marked as duplicate by Gilles, jasonwryan, slm, Sukminder, Anthon Jun 8 '13 at 3:27

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 Answer

up vote 4 down vote accepted

For deleting a file you have to modify the containing directory to not list that file anymore. Seems you have no w-permission on that directory.

In this case you cannot create and delete files there you can only modify/delete the content of the file.

share|improve this answer
    
I was not aware of this relation to the containing directory.I thought given 777 permissions ,I can do anything with the file. –  g4ur4v May 23 '13 at 9:07
1  
Yes, you can do anything with the file itself. But "deleting a file" is actually just unlinking the reference to it in the directory, i.e. you really only change the directory not the file. –  michas May 23 '13 at 9:24
add comment

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