EZA: The Best LS Command Replacement
Tags: commandline, shell, tooling
Published: 2023-09-18 13:17:39

Always actual version and more info:  [https://denshub.com](https://denshub.com)

The [ls command](https://man7.org/linux/man-pages/man1/ls.1.html) 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](https://the.exa.website/) 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](https://bsago.me/)): "*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](https://github.com/ogham/exa) (~**23K**⭐️) and it's sad but true - the main news says that exa is unmaintained :( However, the world is not without [good people](https://github.com/ariasuni), who are passionate about keeping valuable projects alive. They made a fork of the project called [eza](https://github.com/eza-community/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
```

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](https://ohmyz.sh/), 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'
```

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
```

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](https://github.com/eza-community/eza#command-line-options).

## 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](https://github.com/lsd-rs/lsd) has almost 11K stars.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/j83b6b38e0psspo7vo8x.png)

👉 Another one would be **colorls**, a Ruby gem that beautifies the terminal's ls command, with color and font-awesome icons. [colorls GitHub repo](https://github.com/athityakumar/colorls) has ~5K stars.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wtrbgp8ke22fwph8tk6m.png)

Feel free to explore even [more alternatives](https://www.linuxlinks.com/best-replacements-ls/), 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.

😉