bash - 文件权限中的句点是什么意思?

标签 bash file-permissions ls

我在“ls -l”的输出中发现了一个我不理解的权限字符:

[root@gnurr ~]# ls -l  /etc/cron.daily/
total 32
-rwxr-xr-x  1 root root  265 Sep 10 16:04 0logwatch
-rwxr-xr-x. 1 root root  118 Aug 17 12:21 cups

文件“cups”的标准权限字符后有句点,但文件“0logwatch”则没有

我到处都发现了很多这样的点——它们也出现在目录或软链接(soft link)中,但它们似乎永远不会出现在我自己创建的文件中。

我发现一些帖子在这个位置提到了“@”或“+”,意思是“扩展属性”或“扩展安全信息”,但没有提到“.”。

有人知道点是什么意思吗?

最佳答案

来自信息/手册页:

GNU 'ls' uses a '.' character to indicate a file with an SELinux security context, but no other alternate access method.

整个部分还提到了一个'+',这是相关的:

Following the file mode bits is a single character that specifies whether an alternate access method such as an access control list applies to the file. When the character following the file mode bits is a space, there is no alternate access method. When it is a printing character, then there is such a method.

GNU 'ls' uses a '.' character to indicate a file with an SELinux security context, but no other alternate access method.

A file with any other combination of alternate access methods is marked with a '+' character.

关于bash - 文件权限中的句点是什么意思?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21132446/

相关文章:

macos - 在 Mac 上使用 compass 的权限问题

Python 应用程序权限被拒绝

powershell - Windows PowerShell 等效于 Linux `ls -l`

linux - ls 在 linux 脚本中有条件地循环

linux - 将目录/文件输入文本文件,然后显示早于特定日期的文件

linux - 移动除某些文件外的所有文件

arrays - 在 Bash 中循环遍历多个数组时关联数组键中的空格

bash - 正则表达式中的匹配括号在 bash 中不起作用

android - 在 Android Studio(华为 P20)中读取 "/sys/class/power_supply/Battery/current_now"的访问权限

arrays - Bash 在 while 循环中构建数组(不持久)?