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

前端之家收集整理的这篇文章主要介绍了bash – `-rw-r – r – @`中的@在`ls -l`输出中是什么意思?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我在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.

原文链接:/bash/385011.html

猜你在找的Bash相关文章