Skip to main content

Let's revisit the ls command thanks to eza

Tired of typing ls -alh? Discover eza, the modern, feature-rich replacement for the basic Linux ls command. Learn how to install it and set up a powerful new alias for a better command-line experience.

· 4 min read
View raw
Christophe
Markdown, WSL and Docker lover ~ Insatiable curious.
Cet article existe aussi en français — lire la version française.

Changelog

Latest
added a Docker-first demo to try before installing
Updated website link from the.eza.website (domain expired) to eza.rocks (current official site).
still accurate, no obsolete info

Let's revisit the ls command thanks to eza

⚡
TL;DR

This article introduces eza, a modern replacement for the ls command (formerly known as exa), offering better defaults, icons, and formatting. It shows how to install it with apt-get and set up an alias with a useful combination of flags (--all --long --group --group-directories-first --icons --header --time-style long-iso) so ls automatically uses eza with a richer file listing.

Which CLI command would you say you use most on Linux? Most definitely ls to display the list of files in the current directory.

I don't know about you, but I rarely use `ls` without any parameters. Almost without thinking, I add `-alh` every time. It's become mechanical.

And then you'll say to me, well, all you have to do is create an alias alias ls="ls -alh"; of course, but let's go further and revisit this basic command and add some functionality to it.

eza is a modern replacement for ls as stated on their website: https://eza.rocks/.

It belongs to the same family of "modern rewrites of the classics" as ripgrep (for grep) and delta (for git diff). While you're customizing your console, Customize your Linux prompt with Powerlevel10k is worth ten minutes too.

eza was first called exa

Result​

Once ls is aliased to eza with a few flags, this is what a plain ls looks like:

eza

Seeing It in Action with Docker​

Before touching your ~/.bashrc, try the alias in a throwaway container with a small, varied folder already set up — a hidden file, a sub-folder or two, files of different sizes — so the listing actually has something to show off.

Why Docker first?

The Dockerfile below installs eza, sets up the exact ls alias from this article, and builds a demo folder for you. Nothing changes on your own machine.

Build and run it:

>user@machine: ~/eza-demo

$ docker build -t eza-demo . [+] Building 14.2s (7/7) FINISHED ✔ exporting to image

$ docker run --rm -it eza-demo 🐳 root ~/demo # ls Permissions Size User Date Modified Name drwxr-xr-x - root 2026-08-22 docs drwxr-xr-x - root 2026-08-22 src .rw-r--r-- 0 root 2026-08-22 .env .rw-r--r-- 8 root 2026-08-22 README.md

That's ls — really eza under the hood, thanks to the alias baked into the image. Icons, grouped folders first, human-readable dates: the same result as the screenshot above, without having installed anything on your own machine yet.

Install eza​

The installation is simple, you just need to run sudo apt-get update && sudo apt-get install eza; nothing more.

From now, simply run eza on the command line and you'll get the list of files with all the defaults presets.

On my computer, I've chosen for this list of parameters: --all --long --group --group-directories-first --icons --header --time-style long-iso and, for sure, I've updated my ~/.bashrc file by adding an alias (if you're on ZSH, give that alias its own file rather than growing a monolithic .zshrc):

>user@machine: ~/yourproject

And, now, by just typing ls, you'll get the listing shown above.


Was this article helpful?
Did you try the steps in this article?