tldr/pages.zh/common/ls.md

37 lines
695 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.

# ls
> 列出目录中的内容。
> 更多信息:<https://www.gnu.org/software/coreutils/ls>.
- 列出目录中的文件,每个文件占一行:
`ls -1`
- 列出包含隐藏文件的所有文件:
`ls -a`
- 列出所有文件,如果是目录,则在目录名后面加上「/」:
`ls -F`
- 列出包含隐藏文件的所有文件信息,包括权限,所有者,大小和修改日期:
`ls -la`
- 列出所有文件信息大小用人类可读的单位表示KiB, MiB, GiB
`ls -lh`
- 列出所有文件信息,按大小降序排序:
`ls -lS`
- 列出所有文件信息,按修改日期从旧到新排序:
`ls -ltr`
- 只列出目录:
`ls -d */`