Overview
This page documents all available flags and options for thesls command. Options can be specified in short form (single dash, single letter) or long form (double dash, full word).
Display Options
All Files
Display all files, including hidden files (those starting with
.).By default, hidden files are not shown.Long Format
Display file attributes in long format, one file per line.Shows: permissions, owner, group, links, size, date, time, and name.
One Line
Display each file on its own line.Useful for piping output to other commands or for simple readability.
Human Readable Sizes
Display file sizes in human-readable format (K, M, G).Only available in long form. Typically used with
-l flag.Visual Enhancements
Colors
Colorize the output based on file type.Different colors help distinguish directories, executables, symlinks, etc.
Icons
Display icons denoting file type.Adds visual indicators before filenames to show file types at a glance.
Classify
Append indicator characters to entries.Adds
/ for directories, * for executables, and other indicators.Recursion and Directory Handling
Recurse
Recurse into directories, listing all subdirectories and their contents.Use with
--depth-limit to control how deep the recursion goes.Depth Limit
Limit recursion depth when using
-r flag.Requires the --recurse flag to be set. Value must be a positive integer.Directory Only
List directories themselves, not their contents.Useful for viewing directory metadata without listing files inside.
Sorting Options
Only one sort option can be active at a time. If multiple sort flags are specified, the last one takes precedence. Default sorting is alphabetical by name.
Sort by Time
Sort by modification time, newest first.Overrides the default alphabetical sorting.
Sort by Size
Sort by file size, largest first.Overrides the default alphabetical sorting.
Arguments
Paths
One or more paths to list.If omitted, lists the current directory. Multiple paths can be specified and each will be listed separately.
Common Combinations
Detailed listing with readable sizes
Detailed listing with readable sizes
All files with icons and colors
All files with icons and colors
Recursive with depth limit
Recursive with depth limit
Recent files first
Recent files first
Largest files first
Largest files first