List files in linux

  1. ls -r to list files in reverse order.
  2. ls -X to files files ordered by extension
  3. ls -d */ to list only directories
  4. ls -S to order files by size (biggest first)
  5. ls -t to order files by modification time (newest first)
  6. ls -c to order files by last change (newest first)
  7. 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.

--

--