Files
tldr/pages.zh/common/ls.md

36 lines
786 B
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# ls
> 列出目录内容。
> 更多信息:<https://www.gnu.org/software/coreutils/manual/html_node/ls-invocation.html>。
- 每行列出一个文件:
`ls -1`
- 列出[所有]文件,包括隐藏文件:
`ls -a`
- 列出带有后缀符号以指示文件类型的文件(目录/、符号链接@、可执行文件*等):
`ls -F`
- 以[长]格式列出[所有]文件(权限、所有权、大小和修改日期):
`ls -la`
- 以[长]格式列出文件,大小使用[人类可读]单位KiB、MiB、GiB显示
`ls -lh`
- 以[长]格式列出文件,按[大小](降序)[递归]排序:
`ls -lSR`
- 以[长]格式列出文件,按文件修改时间排序,并以[反向]顺序(最旧的在前):
`ls -ltr`
- 仅列出[目录]
`ls -d */`