tldr/pages.zh/osx/stat.md

25 lines
477 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

# stat
> 显示文件状态。
> 更多信息:<https://ss64.com/osx/stat.html>.
- 显示文件属性,如大小、权限、创建和访问日期等:
`stat {{文件}}`
- 与上面相同,但更详细(更类似于 Linux 的 `stat`
`stat -x {{文件}}`
- 只显示文件权限:
`stat -f %Mp%Lp {{文件}}`
- 显示文件的所有者和所属组:
`stat -f "%Su %Sg" {{文件}}`
- 以字节为单位显示文件的大小:
`stat -f "%z %N" {{文件}}`