lsd ls with colors and icons

Version 1.2.0 · source

Start here

lsd
List with colors and icons
lsd -l
Long table
lsd -la
Long, with hidden files
lsd --tree
Tree view
lsd --tree --depth 2
Limit tree depth
lsd -lt
Newest last
lsd -lS
Biggest last
lsd --git -l
Show git status

Concepts

  1. Config file config.yaml
  2. Flags --tree, -l, --sort
  3. Listing colors + icons

Listing

lsd [<path>]
List a directory
lsd -a
Include hidden entries
lsd -A
Hidden, but not dot entries
lsd -l
Long table with permissions and sizes
lsd -1
One entry per line
lsd -d <path>
List the directory itself, not contents
lsd -L
Follow symlinks to their targets
lsd --no-symlink
Hide symlink targets
lsd -F
Append type indicators
lsd -I <glob>
Hide names matching a glob
Repeat the flag for several patterns.
lsd -N
Print names without quotes

Tree and recursion

lsd --tree
Show a tree
lsd --tree --depth <n>
Tree limited to n levels
lsd --tree -a -I .git
Tree with hidden files, minus .git
lsd --tree -l
Tree with long columns
lsd -R
Recurse into subdirectories
lsd -R --depth <n>
Recurse to a limited depth
lsd --tree --total-size
Directory sizes in the tree

Sorting

lsd -t
Sort by modification time
lsd -S
Sort by size
lsd -X
Sort by extension
lsd -v
Natural version sort
lsd -r
Reverse the order
lsd -U
Keep directory order
lsd --sort <key>
Sort by size, time, version, extension or git
lsd --group-dirs first
Directories before files
lsd --group-dirs last
Directories after files

Long format columns

lsd -l --blocks <list>
Pick and order columns
Comma-separated: permission, user, group, size, date, name, inode, git.
lsd -l --header
Show column headers
lsd -l --size short
Short sizes such as 1.2M
lsd -l --size bytes
Exact sizes in bytes
lsd -l --date relative
Dates like 2 days ago
lsd -l --date '+<format>'
Custom strftime date
lsd -l --permission octal
Permissions as 0644
lsd -l -i
Show inode numbers
lsd -l -Z
Show security context
lsd --total-size -l
Sum up directory contents
lsd --git -l
Show git status per file

Colors and icons

lsd --color never
Turn colors off
lsd --color always
Force colors, e.g. into a pager
lsd --icon never
Turn icons off
lsd --icon-theme unicode
Plain unicode icons, no Nerd Font
lsd --hyperlink auto
Clickable file names
lsd --classic
Behave like plain ls

Configuration

lsd --config-file <path>
Use another config file
lsd --ignore-config
Skip the config file
~/.config/lsd/config.yaml
Main config file location
colors.yaml and icons.yaml in the same folder hold overrides.
config.yaml keys
Key Example Effect
layout tree grid, tree or oneline
blocks [permission, size, name] Long columns
sorting.dir-grouping first Directories first
date relative Date style
icons.theme unicode Icon set
ignore-globs [.git] Always hidden

Help

lsd --help
List all options
lsd --version
Show installed version

Recipes

Aliases for your shell
alias ls='lsd'alias l='ls -l'alias la='ls -a'alias lla='ls -la'alias lt='ls --tree'
Project overview
lsd --tree --depth 2 -I .git -I node_modules
What changed recently
lsd -ltr --date relative --group-dirs none
Minimal config
# ~/.config/lsd/config.yamldate: relativesorting:  dir-grouping: firsticons:  theme: unicode