在 Mac 上使用 coreutils ls 查看扩展属性

Zev*_*erg 5 osx shell coreutils xattr

我在运行 OS X 10.8.4 的 Mac 上通过 MacPorts 安装了 coreutils。我已ls设置为在可用时使用ls[ (GNU coreutils) 8.21]的 coreutils 版本:

if [ -e /opt/local/libexec/gnubin ]; then
    alias ls='/opt/local/libexec/gnubin/ls --color=auto'
else
    alias ls='/bin/ls -G'
fi
Run Code Online (Sandbox Code Playgroud)

当我ls -l在包含已知具有扩展属性 (xattrs) 的文件的目录中运行时,我希望@在这些列表中的权限之后看到一个符号。但是,我看不到任何@迹象。如果我跑/bin/ls -l,我会得到@标志。

文件列表来自/bin/ls -l

-rw-r--r--@  1 zev.eisenberg  staff  132887 Jul 19 16:24 flowchart.graffle
Run Code Online (Sandbox Code Playgroud)

文件列表来自ls -l(使用 coreutils):

-rw-r--r--  1 zev.eisenberg staff 132887 Jul 19 16:24 flowchart.graffle
Run Code Online (Sandbox Code Playgroud)

当 xattrs 存在时,如何让 coreutils 版本ls向我显示@符号?

Zev*_*erg 2

我相信 Mark Cohen\xe2\x80\x99s 的评论是正确的:这个功能似乎在ls. 我实际上没有充分的理由使用 coreutils ls,所以我切换回内置的 BSD 版本。

\n