Here are some commonly used ls options:
-
-l: Long listing format, which provides detailed information about each file, including permissions, number of links, owner, group, size, and timestamp. -
-a: Lists all files, including hidden files (those starting with a dot). -
-h: Human-readable sizes (when used with-l), displaying file sizes in KB, MB, etc. -
-t: Sorts files by modification time, with the most recently modified files listed first. -
-S: Sorts files by size, with the largest files listed first. -
-r: Reverses the order of the sort (e.g., shows the oldest files first when used with-t). -
-d: Lists directories themselves, not their contents. -
-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.
