0

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 ?

g4ur4v
  • 1,764
  • 8
  • 29
  • 34

1 Answers1

4

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.

michas
  • 21,510
  • 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 09: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 09:24