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?

muru
  • 197,895
  • 55
  • 485
  • 740
wim
  • 12,738

1 Answers1

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.

Tim
  • 32,861
  • 27
  • 118
  • 178
  • 1
    What's the practical implication of having the x bit set vs unset, given that the sticky bit is set? Thanks! – Tootsie Rolls Oct 21 '13 at 03:50
  • Is this meant only to protect renaming and deleting? How about chaning the content in the files? – A-letubby Feb 02 '16 at 06:58
  • @zanna Hope my edits are okay – Tim Jun 05 '17 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. – Matthias Braun Oct 01 '20 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. – Some Linux Nerd Feb 03 '21 at 02:19