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
|
|
|
|
2014-04-16 19:24:01 +01: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
|
|
|
|
|
2014-03-02 07:31:17 +00:00
|
|
|
`ls {{prefix}}*`
|
2015-10-28 17:10:44 +00:00
|
|
|
|
2014-03-02 07:31:17 +00:00
|
|
|
`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`
|
2015-10-28 17:10:44 +00:00
|
|
|
|
2014-09-17 17:13:24 +01:00
|
|
|
`ls -t`
|
2015-10-28 17:10:44 +00:00
|
|
|
|
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`
|