1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2024-10-31 04:17:55 +01:00
tldr/pages/common/ls.md

35 lines
491 B
Markdown
Raw Normal View History

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