Matthew Orndoff

Matthew Orndoff

Web Developer, student, and Cold Brew afficiando. Just tryna keep it 💯

exa > ls

exa is a modern replacement for ls that brings nice colors and more intuitive options by default.

exa has an ungodly level of command-line options; so instead of needlessly recreating the documentation, the combinations I’ve listed below are my go-tos.

Trees

Display files in directory as tree, with long descriptions.

exa -Tl

Display all files in directory as tree, with long descriptions.

exa -Tla

Display files in directory as tree, going down X levels deep.

exa -TL=2   # Going down 2 levels here.

Display all files in directory as tree, going down X levels deep.

exa -TaL=2

Sorting

Display files in directory with long descriptions. Sort by size.

exa -ls=size  # Smaller files listed first. Add -r flag to reverse ordering.

Display files in directory with long descriptions. Sort by extension.

exa -ls=ext   # Default case-insensitive. Use 'Ext' for case-sensitive.

Display files in directory with long descriptions. Sort by type and list the file group.

exa -lgs=type

Typing out exa is slightly more awkward than typing out ls, but if you just pick a few command combinations you like and turn them into an aliases, you can seriously minimize your typing.

TTFN!