Skip to main content

Overview

This page documents all available flags and options for the sls command. Options can be specified in short form (single dash, single letter) or long form (double dash, full word).

Display Options

All Files

-a, --all
flag
default:"false"
Display all files, including hidden files (those starting with .).By default, hidden files are not shown.
sls -a
sls --all

Long Format

-l, --long
flag
default:"false"
Display file attributes in long format, one file per line.Shows: permissions, owner, group, links, size, date, time, and name.
sls -l
sls --long

One Line

-1, --one-line
flag
default:"false"
Display each file on its own line.Useful for piping output to other commands or for simple readability.
sls -1
sls --one-line

Human Readable Sizes

--human-readable
flag
default:"false"
Display file sizes in human-readable format (K, M, G).Only available in long form. Typically used with -l flag.
sls -l --human-readable

Visual Enhancements

Colors

-c, --color
flag
default:"false"
Colorize the output based on file type.Different colors help distinguish directories, executables, symlinks, etc.
sls -c
sls --color

Icons

-i, --icons
flag
default:"false"
Display icons denoting file type.Adds visual indicators before filenames to show file types at a glance.
sls -i
sls --icons

Classify

-F, --classify
flag
default:"false"
Append indicator characters to entries.Adds / for directories, * for executables, and other indicators.
sls -F
sls --classify

Recursion and Directory Handling

Recurse

-r, --recurse
flag
default:"false"
Recurse into directories, listing all subdirectories and their contents.Use with --depth-limit to control how deep the recursion goes.
sls -r
sls --recurse

Depth Limit

-L, --depth-limit
option
default:"unlimited"
Limit recursion depth when using -r flag.Requires the --recurse flag to be set. Value must be a positive integer.
sls -r -L 2
sls --recurse --depth-limit 3

Directory Only

-d, --directory
flag
default:"false"
List directories themselves, not their contents.Useful for viewing directory metadata without listing files inside.
sls -d /usr/local
sls --directory ~/Documents

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

-t, --sort-time
flag
default:"false"
Sort by modification time, newest first.Overrides the default alphabetical sorting.
sls -t
sls --sort-time

Sort by Size

-S, --sort-size
flag
default:"false"
Sort by file size, largest first.Overrides the default alphabetical sorting.
sls -S
sls --sort-size

Arguments

Paths

paths
argument
default:"current directory"
One or more paths to list.If omitted, lists the current directory. Multiple paths can be specified and each will be listed separately.
sls /tmp
sls ~/Documents ~/Downloads
sls /var/log /etc

Common Combinations

sls -l --human-readable
Shows file details with sizes in K, M, G format instead of bytes.
sls -a -i -c
Displays hidden files with visual enhancements for better readability.
sls -r -L 2
Lists subdirectories up to 2 levels deep.
sls -l -t --human-readable
Shows detailed file information sorted by modification time.
sls -l -S --human-readable
Shows detailed file information sorted by size, largest first.

Version and Help

Display Help

sls --help
Shows usage information and a summary of all available options.

Display Version

sls --version
Shows the installed version of sls (currently 1.5.0).

Build docs developers (and LLMs) love