DEV Community

Cover image for EZA: The Best LS Command Replacement
Denis Rasulev
Denis Rasulev

Posted on • Edited on • Originally published at denshub.com

EZA: The Best LS Command Replacement

Always actual version and more info: https://denshub.com

The ls command is a commonly used in Unix-like operating systems to list files and directories within a directory. While ls is the standard command for this purpose, there are several alternatives and enhancements available that provide additional features and options. I've been using exa for a long time. It has been a favorite among many other users for its versatility and robust feature set.

Described by its author, Benjamin Sago (a.k.a. Ogham): "exa is an improved file lister with more features and better defaults. It uses colours to distinguish file types and metadata. It knows about symlinks, extended attributes, and Git. And it’s small, fast, and just one single binary."

Today, while updating installed packages, brew reported that exa is deprecated and no longer supported. I've checked the exa GitHub repo (~23K⭐️) and it's sad but true - the main news says that exa is unmaintained :( However, the world is not without good people, who are passionate about keeping valuable projects alive. They made a fork of the project called eza and it is actively supported by a dedicated team.

If you've been using "exa" and want to make the transition to "eza," the process on your Mac is straightforward:

brew remove exa
brew install eza
Enter fullscreen mode Exit fullscreen mode

After installation, update your aliases as needed to align with your preferred usage.

First time?

If you are just stumbled upon this great tool, then after installing it with brew install eza, edit your favorite shell config file and add there the following lines below. Since I use zsh with OhMyZsh, I edited .zshrc and added there these lines:

ld='eza -lD'
lf='eza -lF --color=always | grep -v /'
lh='eza -dl .* --group-directories-first'
ll='eza -al --group-directories-first'
ls='eza -alF --color=always --sort=size | grep -v /'
lt='eza -al --sort=modified'
Enter fullscreen mode Exit fullscreen mode

Now I'll explain what they do.... But first, let me remind you that whatever command you call, it works in the directory you are currently in!

ld - lists only directories (no files)
lf - lists only files (no directories)
lh - lists only hidden files (no directories)
ll - lists everything with directories first
ls - lists only files sorted by size
lt - lists everything sorted by time updated
Enter fullscreen mode Exit fullscreen mode

Some eza features that are not in exa (non-exhaustive):

  • Fixes “The Grid Bug” introduced in exa 2021
  • Hyperlink support
  • Selinux context output
  • Git repo status output
  • Human readable relative dates
  • Several security fixes (see dependabot)
  • Many smaller bug fixes/changes

For many other command-line options, please, go to the official eza GitHub repo.

More Alternatives

If you are still burning to see alternative solutions, I would mention here just two.

👉 One is lsd, "the next gen ls command", written in Rust. lsd GitHub repo has almost 11K stars.

Image description

👉 Another one would be colorls, a Ruby gem that beautifies the terminal's ls command, with color and font-awesome icons. colorls GitHub repo has ~5K stars.

Image description

Feel free to explore even more alternatives, but I highly recommend you stick with eza.

Summary

To summarize, it is safe to say that eza will become your main replacement for the "ls" command, used in a completely natural way, with greater comfort and productivity. I'm sure it will help you to improve your work in the terminal and increase your productivity!

In the video you can see how it all works and learn some useful tips and tricks.

To see live demo and learn how to work with standard commands, watch this video on YouTube: https://youtu.be/tM0hyO3HSxQ

Enjoy.

😉

Top comments (0)