What are common ls command options?

QuestionsQuestions8 SkillsProBasic Files OperationsAug, 19 2025
0345

Here are some common options for the ls command:

  1. -l: Lists files in long format, providing detailed information such as permissions, owner, size, and modification date.

    ls -l
  2. -a: Includes hidden files (those starting with a dot) in the listing.

    ls -a
  3. -h: When used with -l, it displays file sizes in a human-readable format (e.g., KB, MB).

    ls -lh
  4. -R: Recursively lists all files and directories in the current directory and its subdirectories.

    ls -R
  5. -t: Sorts files by modification time, with the most recently modified files listed first.

    ls -lt
  6. -S: Sorts files by size, with the largest files listed first.

    ls -lS

These options can be combined for more specific listings, such as ls -la to show all files in long format.

0 Comments

no data
Be the first to share your comment!