tldr/pages/common/ls.md

38 lines
475 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
2015-12-15 21:10:32 +00:00
`ls -l`
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`
2014-09-17 17:13:24 +01:00
`ls -t`
2014-09-17 17:13:24 +01:00
`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`