tldr/pages/common/ls.md

37 lines
763 B
Markdown
Raw Normal View History

2014-01-28 09:27:02 +00:00
# ls
> List directory contents.
> More information: <https://www.gnu.org/software/coreutils/ls>.
2014-01-28 09:27:02 +00:00
- List files one per line:
2014-01-28 09:27:02 +00:00
`ls -1`
2014-01-28 09:27:02 +00:00
- List [a]ll files, including hidden files:
2014-01-28 09:27:02 +00:00
`ls -a`
2014-01-28 09:27:02 +00:00
- List files with a trailing symbol to indicate file type (directory/, symbolic_link@, executable*, ...):
`ls -F`
- List [a]ll files in [l]ong format (permissions, ownership, size, and modification date):
2014-01-28 09:27:02 +00:00
`ls -la`
2014-01-28 21:58:16 +00:00
- List files in [l]ong format with size displayed using [h]uman-readable units (KiB, MiB, GiB):
`ls -lh`
- List files in [l]ong format, sorted by [S]ize (descending) [R]ecursively:
2014-02-21 22:05:52 +00:00
`ls -lSR`
- List files in [l]ong format, sorted by [t]ime the file was modified and in [r]everse order (oldest first):
2016-01-27 16:44:05 +00:00
`ls -ltr`
2021-05-14 01:40:50 +01:00
- Only list [d]irectories:
2021-05-14 01:40:50 +01:00
2021-10-13 07:26:17 +01:00
`ls -d */`