tldr/pages/common/ls.md

35 lines
473 B
Markdown
Raw Normal View History

2014-01-28 09:27:02 +00:00
# ls
> List directory contents
- List all files, even hidden
`ls -a`
2014-03-02 07:30:07 +00:00
- List all file names (no extra info)
2014-01-28 09:27:02 +00:00
2014-03-02 07:30:07 +00:00
`ls -A1`
2014-01-28 09:27:02 +00:00
- List all files with their rights, groups, owner
`ls -ls`
2014-01-28 21:58:16 +00:00
- List all files and display the file size in a human readable format
`ls -lh`
2014-01-28 21:58:16 +00:00
- List all files with a prefix/suffix
`ls {{prefix}}*`
`ls *{{suffix}}`
2014-01-28 21:58:16 +00:00
2014-09-17 17:13:24 +01:00
- Sort the results by size, last modified date, or creation date
2014-01-28 21:58:16 +00:00
2014-09-17 17:13:24 +01:00
`ls -S`
`ls -t`
`ls -U`
2014-02-21 22:05:52 +00:00
2014-03-02 07:30:07 +00:00
- Reverse the order of the results
2014-02-21 22:05:52 +00:00
2014-03-02 07:30:07 +00:00
`ls -r`