What are common ls options?

QuestionsQuestions8 SkillsProBasic Files OperationsAug, 02 2025
0181

Here are some common options for the ls command in Linux:

  1. -l: Long listing format. Displays detailed information about each file, including permissions, owner, size, and modification date.

    ls -l
  2. -a: Lists all files, including hidden files (those starting with a dot).

    ls -a
  3. -h: Human-readable sizes. Used with -l to display file sizes in a more understandable 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 newest files first.

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

    ls -lS
  7. -r: Reverses the order of the sort.

    ls -lr

You can combine these options for more customized output. For example:

ls -lha

If you have any more questions or need further assistance, feel free to ask!

0 Comments

no data
Be the first to share your comment!