What are other common `ls` options?

QuestionsQuestions8 SkillsProBasic Files OperationsSep, 15 2025
0113

Here are some common ls options you can use to customize the output:

  1. -l: Long format listing, showing detailed information (permissions, owner, size, date).
  2. -a: Lists all files, including hidden files (those starting with a dot).
  3. -h: Displays file sizes in a human-readable format (e.g., KB, MB).
  4. -R: Recursively lists all files in subdirectories.
  5. -S: Sorts files by size, largest first.
  6. -t: Sorts files by modification time, newest first.
  7. -r: Reverses the order of the sort (e.g., oldest first).
  8. -X: Sorts files alphabetically by file extension.
  9. -1: Lists one file per line.

You can combine these options for more tailored output. For example, ls -lhS would give you a long listing with human-readable sizes, sorted by size. If you have any more questions or need further clarification, feel free to ask!

0 Comments

no data
Be the first to share your comment!