48

enter image description here

What's that capital 'T' in the permissions mean, and how does it work? Is it related to this 'sticky bit' thing I've heard about but never quite understood?

1 Answer 1

29

The uppercase T appears when the x bit for "others" (ie in the last position) is not set. Both of these directories have the sticky bit set, but the second one has no execute permission for "others"

drwxrwxrwt 2 zanna zanna 4096 May 13 09:53 t
drwxrwxrwT 2 zanna zanna 4096 May 13 09:53 T

Since it is replaced by the sticky bit's [tT], we need some way of knowing whether the directory has execute permission for "others" or not, hence the difference in case

In our file browser, the Permissions tab under Properties shows the differences between directories with and without execute permissions more clearly: we need execute permission to access (enter or stat) a directory.

Here's what Wikipedia has to say about the sticky bit on directories:

The most common use of the sticky bit today is on directories. When the sticky bit is set, only the item's owner, the directory's owner, or the superuser can rename or delete files. Without the sticky bit set, any user with write and execute permissions for the directory can rename or delete contained files, regardless of owner. Typically this is set on the /tmp directory to prevent ordinary users from deleting or moving other users' files. This feature was introduced in 4.3BSD in 1986 and today it is found in most modern Unix systems.

5
  • 1
    What's the practical implication of having the x bit set vs unset, given that the sticky bit is set? Thanks! Commented Oct 21, 2013 at 3:50
  • Is this meant only to protect renaming and deleting? How about chaning the content in the files?
    – A-letubby
    Commented Feb 2, 2016 at 6:58
  • @zanna Hope my edits are okay
    – Tim
    Commented Jun 5, 2017 at 11:27
  • In practical terms, I'd say uppercase T indicates a misconfigured directory: The sticky bit means that users can only delete those files they own in the directory (not any files of other owners). But the missing executable permission means they can't create a file in that directory anyway (or read anything, for that matter). I don't see any sense in this two-fold restriction. See also this answer for more on directory permissions. Commented Oct 1, 2020 at 18:48
  • It's because there's only one sticky bit (it does it's thing for everyone, so that includes your group). I just realized that the idea is that the capitalization lets you see under the T. Commented Feb 3, 2021 at 2:19

You must log in to answer this question.

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