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

What does @ in `-rw-r--r--@` mean in the `ls -l` output?

我正在 Mac OS X

上的 bash 完成文件夹中检查 ls -l 的输出
$ 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

我不明白 @-rw-r--r--@ 中是什么意思?

表示文件有extended attributes。您可以使用 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

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

来自 osx ls 手册页:

The Long Format
If the file or directory has extended attributes, the permissions field printed by the -l option is followed by an @ character. Otherwise, if the file or directory has extended security information, the permissions field printed by the -l option is followed by a + character.

-@ Display extended attribute keys and sizes in long (-l) output.