Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Q&A

What does capital T mean in the output of 'ls -l'?

+3
−0

I had a nightly cronjob start throwing errors about "inappropriate permissions..."

rsync: [generator] failed to set permissions on "/data2/home/redacted/alsoredacted/opt/dell/srvadmin/var/log/openmanage/omcmdlog.xml": Inappropriate file type or format (79)
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1179) [sender=3.1.2]

Looking into it I found:

[myname@myserver ~]$ ls -l /opt/dell/srvadmin/var/log/openmanage/omcmdlog.xml
-rw-rw-r-T. 1 root root 735 Dec 19 22:03 /opt/dell/srvadmin/var/log/openmanage/omcmdlog.xml

I suspected the 'sticky bit'.

Googling it I found this:

`T'
      If the restricted deletion flag or sticky bit is set but the
      other-executable bit is not set.

I thought lsattr would show it if it was set sticky but I guess not:

$ lsattr /opt/dell/srvadmin/var/log/openmanage/omcmdlog.xml
-------------e-- /opt/dell/srvadmin/var/log/openmanage/omcmdlog.xml

What does the capital T mean and how do I get rid of it?

History
Why does this post require moderator attention?
You might want to add some details to your flag.
Why should this post be closed?

0 comment threads

2 answers

You are accessing this answer with a direct link, so it's being shown above all other answers regardless of its activity. You can return to the normal view.

+4
−0

The reason why you don't find this in man ls is that the GNU project (that developed Coreutils) usually provides the complete documentation of its components not in classic manual pages, but in so called Info documents (for more context, see Unix & Linux: What is GNU Info for?), and that is indeed disclaimed in the end of man ls.

The fragment you have quoted, which claims it is the sticky bit, is authoritative: It is from GNU Coreutils Info document itself, §10.1.2 What information is listed. And, for completeness, this is Coreutils, §27.1 Structure of File Mode Bits, defining the jargon:

The restricted deletion flag or sticky bit.

Prevent unprivileged users from removing or renaming a file in a directory unless they own the file or the directory; this is commonly found on world-writable directories like /tmp. For regular files on some older systems, save the program’s text image on the swap device so it will load more quickly when run, so that the image is “sticky”.

Regarding "how to get rid of it", first note the permissions symbolic notation, in which, skipping the foremost bit, which denotes file type,

  • The 1st three bits (rw-) denote owner — often called user — permissions,
  • The 2nd three bits (rw-) the group permissions,
  • The 3rd three bits (r-T) the other permissions.

Thus, reading man chmod, simple ways to remove it are

chmod o-t file
chmod -t file

o means "other" and -t "remove the sticky bit". Since the t bit can only appear in the other field, it can be omitted without ambiguity.

History
Why does this post require moderator attention?
You might want to add some details to your flag.

0 comment threads

+1
−0

To get rid of it, I ran:

$ sudo chmod  o-t /opt/dell/srvadmin/var/log/openmanage/omcmdlog.xml
$ ls -l /opt/dell/srvadmin/var/log/openmanage/omcmdlog.xml 
-rw-rw-r--. 1 root root 735 Dec 19 22:03 /opt/dell/srvadmin/var/log/openmanage/omcmdlog.xml

I am still not entirely sure if it was sticky or setuid (more likely) but there's no reason that file should have been specially permissioned.

History
Why does this post require moderator attention?
You might want to add some details to your flag.

1 comment thread

Works for me (1 comment)

Sign up to answer this question »