List files in linux
Jul 15, 2021
ls -r
to list files in reverse order.ls -X
to files files ordered by extensionls -d */
to list only directoriesls -S
to order files by size (biggest first)ls -t
to order files by modification time (newest first)ls -c
to order files by last change (newest first)ls -m
to list all directory content in a single line (separated by commas)
Most Common Combinations
ls -lSr
— long listing, order by size, reverse order
ls -ltr
— long listing, order by modified date, reverse order
Explanatory notes
ad 6. “Last change” of the file doesn’t have to include file modification. It can as well be a change of permissions or ownership.