The letter A styled as Alchemists logo. lchemists
Published February 15, 2021 Updated February 15, 2021

Shell Exa

Demonstrates using the Exa program for listing files and directories.


# Hello and welcome to the Alchemists Screencasts!
# Today, we'll look at using Exa (

# Exa is a powerful enhancement to native `ls` functionality.
# Due to being implemented in Rust (, it's fast too.
# For those on macOS, you can install via Homebrew (

brew install exa

# For comparison, here is native `ls` versus `exa` functionality:


# At first glance, the difference is subtle but you can see Exa is more concise.
# We can expand upon the above by comparing/contrasting a list view:

ls -alhT
exa --all --long

# Colorization is an immediate visible differentiator over `ls`.
# The succinctness of output -- without losing detail -- is another bonus.
# Here's what I like to use:

exa --all \
    --long \
    --header \
    --group \
    --group-directories-first \
    --time-style long-iso \
    --git \

# That's a lot to type so I have the above aliased:

cype x

# Now we only need to type `x` for the same result 🎉:


# Here's the breakdown of options used:
# `--all`                     - Show hidden and dot files.
# `--long`                    - Displays file metadata as a table.
# `--header`                  - Adds column headers.
# `--group`                   - Shows file's group.
# `--group-directories-first` - Lists directories before other files.
# `--time-style long-iso`     - Uses long ISO date/time stamps.
# `--git`                     - Shows Git status for file.
# `--git-ignore`              - Ignores files listed `.gitignore`.

# Use of `--git` needs more illustration, so I'll make some file changes:

printf "%s\n" "This is a test." >
printf "%s\n" "This is a test." >
git add
touch test.txt

# First, notice `N` (new) next to `text.txt` since the file is new to Git.
# Second, notice `-M` (modified) next to `` since the file is modified.
# Third, notice `M-` (staged) next to `` since the file is staged.
# For further Git details, see:

# Much like `ls`, Exa supports a one line view too:

ls -A1
exa --oneline --all --group-directories-first

# I like to alias the above as `x1`:

cype x1

# Finally, Exa has native tree support which I quite enjoy:

exa --tree

# I like to use the `xt` for this:

cype xt

# During this screencast, you might have noticed I use custom colors.
# To configure colors, Exa supports global constants which I define in `$HOME/.bashrc`:

export EXA_COLORS="da=1;34:di=32:gm=33:gd=31"

# For details on Exa's color keys and values, see:
# Finally, I recommend strict mode to prevent incompatible command line options:

export EXA_STRICT=true

# For more Exa features, see:
# You can also study my Dotfiles project:

# Enjoy!
# ☿ 🜔 🜍 🜂 🜃 🜁 🜄