ls
报告以下内容:
# ls -ld /var/lib/puppet/state/
drwxr-xr-t 3 puppet puppet 4096 Jan 8 16:53 /var/lib/puppet/state/
“t”对其他人意味着什么?什么工具报告权限的符号名称? ls
有--numeric-uid-gid
选项,但还有另一个权限吗?
答案 0 :(得分:7)
man ls
是你的朋友:
t粘滞位已设置(模式1000),可搜索或可执行 (参见chmod(1)或sticky(8)。)
关于sticky bit:
设置后,它指示操作系统在退出进程后在交换空间中保留程序的文本段。这通过允许内核进行将程序从交换移动到实内存的单个操作来加速后续执行。因此,编辑器等常用程序的加载速度会明显加快。
答案 1 :(得分:4)
The sticky bit is today incredibly confusing. It no longer pins the file into memory, making it actually "sticky", anymore. Sometimes it is called the "tacky" bit because it is represented as a 't' or 'T', but other folks still call it sticky. It only matters in modern linux and unix when applied to a directory, as far as I can tell. It means that people in groups who have the permission to delete a file still can't do it if the sticky bit is set on the directory. But it gets more confusing. It shows up in the last field, which is the execute/search field for "other" users, but acts on "group" users ("other" normal users can never delete files). The reason why it isn't shown in the "group" execute field is because that one changes to an "s" if the SETUID bit is set for group. I think. I am still researching that one.