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