%a 是 stat 的选项吗?

%a 是 stat 的选项吗?
Usage: stat [OPTION]... FILE...
Display file or file system status.

  -L, --dereference     follow links
  -f, --file-system     display file system status instead of file status
  -c  --format=FORMAT   use the specified FORMAT instead of the default;
                          output a newline after each use of FORMAT
      --printf=FORMAT   like --format, but interpret backslash escapes,
                          and do not output a mandatory trailing newline.
                          If you want a newline, include \n in FORMAT
  -t, --terse           print the information in terse form
      --help     display this help and exit
      --version  output version information and exit

The valid format sequences for files (without --file-system):

  %a   Access rights in octal
  %A   Access rights in human readable form

...

%a也是一种选择吗?

我们如何使用它?

答案1

它是格式说明符为了选项 -c而不是其本身的一个选项,例如

$ stat -c '%a' myfile
664

或者

$ stat -c '%n %a' myfile
myfile 664

相关内容