I have been learning Linux from few days, and now I am at File Parmissions with sticky bits, I tried the following:

[root@localhost sdcdir]# ll
total 24
drwx------. 2 root root 16384 Mar 21 21:38 lost+found
drwxrws--T. 2 root g1    4096 Mar 23 01:22 testdir

g1 is the group that has Pavan, Sudheer and Surendra as members and Surendra is the group administrator (i.e. gpasswd -A Surendra)

Now, Pavan create a file p1 in testdir:

[Pavan@localhost testdir]$ touch f1
[Pavan@localhost testdir]$ ll
total 0
-rw-rw-r--. 1 Pavan g1 0 Mar 23 01:33 f1
[Pavan@localhost testdir]$ 

When I am trying to delete it with Surendra Account I am getting error:

[Surendra@localhost sdcdir]$ cd testdir/
[Surendra@localhost testdir]$ ll
total 0
-rw-rw-r--. 1 Pavan g1 0 Mar 23 01:33 f1
[Surendra@localhost testdir]$ rm f1
rm: cannot remove `f1': Operation not permitted
[Surendra@localhost testdir]$ 

File f1 has g1 as groupowner yet file is not being able to be deleted except by Pavan himself. When setgid, group is set the owner, why cant any member of group delete the file?

  • I think that you forgot to ask an actual question :)
    – MDMarra
    Commented Mar 22, 2012 at 20:35

1 Answer 1


I think you are trying to delete f1 in sdcdir (what is its permissions?), not in testdir. That may be your problem. in this case f1 is owned by root and only has write permission set for the owner (root) and a user with uid not 0 will not be able to delete it.

To delete a file, you must have both write and execute permission to its directory.

  • Sorry for the trouble, correct wrong information, the file f1 is in testdir only
    – surpavan
    Commented Mar 22, 2012 at 20:29
  • in that case, still you have the issue of having the both the execute and write rights in the entire directory chain, not just the parent directory of the file itself. Not sure what you are trying to achieve, but modern linux supports acl, which may be a better alternative based on what you are trying to do, at least on the surface.
    – johnshen64
    Commented Mar 22, 2012 at 20:40
  • ok, so group cannot have control over the entire directory content like what a user can have. Did I understand correctly?
    – surpavan
    Commented Mar 22, 2012 at 20:41
  • You can say that because directory permissions are more complicated than file permissions.
    – johnshen64
    Commented Mar 22, 2012 at 23:43

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .