`-rw-r - r - @`中的@在`ls -l`输出中是什么意思?

abh*_*ker 10 macos bash ls

我正在检查ls -lMac OS X上的bash完成文件夹的输出

$ ls -alrth /usr/local/etc/bash_completion.d/docker-machine* 
-rw-r--r--@ 1 abhimskywalker  staff   1.4K Jun 13 19:04 /usr/local/etc/bash_completion.d/docker-machine-prompt.bash
-rw-r--r--@ 1 abhimskywalker  staff   1.5K Jun 13 19:36 /usr/local/etc/bash_completion.d/docker-machine-wrapper.bash
-rw-r--r--@ 1 abhimskywalker  staff   6.8K Jun 13 19:37 /usr/local/etc/bash_completion.d/docker-machine.bash
Run Code Online (Sandbox Code Playgroud)

我无法理解这@意味着-rw-r--r--@什么?

ach*_*ref 13

它表示该文件具有扩展属性.您可以使用xattr命令行实用程序来查看和修改它们:

xattr -l file # lists the names of all xattrs.
xattr -w attr_name attr_value file # sets xattr attr_name to attr_value.
xattr -d attr_name file # deletes xattr attr_name.
xattr -c file # deletes all xattrs.
xattr -h # prints help
Run Code Online (Sandbox Code Playgroud)

您还可以使用它ls -l@来查看有关这些扩展属性的更多信息.

从osx ls手册页:

长格式
如果文件或目录具有扩展属性,则-l选项打印的权限字段后跟@字符.否则,如果文件或目录具有扩展的安全信息,则-l选项打印的权限字段后跟+字符.

- @在long(-l)输出中显示扩展属性键和大小.

  • 正如你所说,我发现答案也更完整,所以我会保留你的改动.谢谢 :) (2认同)