What other `ls` options are there?

Here are some commonly used ls options:

  1. -l: Long listing format, which provides detailed information about each file, including permissions, number of links, owner, group, size, and timestamp.

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

  3. -h: Human-readable sizes (when used with -l), displaying file sizes in KB, MB, etc.

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

  5. -S: Sorts files by size, with the largest files listed first.

  6. -r: Reverses the order of the sort (e.g., shows the oldest files first when used with -t).

  7. -d: Lists directories themselves, not their contents.

  8. -R: Recursively lists all files and directories in the specified directory and its subdirectories.

You can combine these options for more specific outputs, such as ls -la for a detailed list of all files, including hidden ones.

0 Comments

no data
Be the first to share your comment!