ls -l 中的@ 是什么意思?

Lar*_*ang 150 osx ls permissions

我正在使用 Mac OSX。当我打字时,ls -l我看到类似的东西

drwxr-xr-x@ 12 xonic  staff    408 22 Jun 19:00 .
drwxr-xr-x   9 xonic  staff    306 22 Jun 19:42 ..
-rwxrwxrwx@  1 xonic  staff   6148 25 Mai 23:04 .DS_Store
-rw-r--r--@  1 xonic  staff  17284 22 Jun 00:20 filmStrip.cpp
-rw-r--r--@  1 xonic  staff   3843 21 Jun 21:20 filmStrip.h
Run Code Online (Sandbox Code Playgroud)

@的意思是什么?

Mic*_*zek 141

它表示文件具有扩展属性。您可以使用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)

  • 在 10.8 (Mountain Lion) 中,--list 无效。是-l。 (9认同)
  • 如果要查找某个类型的所有文件并删除 OSX 中的隔离属性:`find 。-iname '*.ext' -print0 | xargs -0 xattr -d com.apple.quarantine`。这就是我发现这个问题的原因。 (5认同)
  • 此外,对于 SEO:@ 是“at 符号” (3认同)
  • @jcollum 更好,`find 。-type f -xattr -print | xargs -0 xattr -d com.apple.quarantine`(不确定是否需要 `-type f`)。尽管出于某种原因,目前这两个命令都对我不起作用......这个对我有用:`find 。-type f -xattr -exec xattr -d com.apple.quarantine {} \;` (2认同)

Kev*_*ntu 34

至少在 Snow Leopard 中,您可以这样做以显示更多信息:

ls -l@
Run Code Online (Sandbox Code Playgroud)