0

My task was to configure a directory so that users in a group could only delete files they own.

I used chmod 1771 RandD, as suggested by lab instructions, to accomplish this.

When running ls -l, the permissions were displayed as drwxrwx--t.

I understand why there is a t at the end of the permissions, since the last 1 in chmod 1771 RandD is responsible for other permissions. However, what is the point of the first 1 if t is not displayed in the user's permissions section?

1 Answers1

4

Some of the characters in ls -l’s output serve multiple purposes; this is what’s happening here with the last character in the permissions. t means that the file has the execute bit for others set, and the sticky bit set.

If the sticky bit wasn’t set, you’d see x instead; if the execute bit wasn’t set, you’d see T.

In chmod, all four digits serve different purposes: the first sets “special” bits (including the sticky bit), the second sets owner permissions, the third sets group permissions, and the fourth sets “other” permissions.

See Understanding UNIX permissions and file types for details.

Stephen Kitt
  • 434,908