top of page
christiandreschler9

Eza: A modern, maintained replacement for "ls", written in rust

Updated: Dec 4



Eza is a modern, maintained replacement for the venerable file-listing command-line program "ls" that ships with Unix and Linux operating systems, giving it more features and better defaults.


It uses colors to distinguish file types and metadata. It knows about symlinks, extended attributes, and Git.


it's small, fast, and just one single binary written in Rust.


By deliberately making some decisions differently, eza attempts to be a more featureful, more user-friendly version of ls.


How to install eza


Debian and Debian-based GNU/Linux distributions (Ubuntu, Linux Mint, MX Linux, etc)

sudo apt install exa


Fedora and Fedora-based GNU/Linux distributions (Nobara, Ublue etc...)

sudo dnf install eza


Arch and Arc-based GNU/Linux distributions

sudo pacman -S eza


How to use eza


Eza is a replacement for ls, and it can only be used in the terminal.

You can launch it by typing :

eza

in some distribution the binary name has not changed yet so, if the previous command doesn't work, just type:

exa


Aliasing eza

If you find it easier, you can create an alias in your shell config (~/.bashrc, ~/.zshrc, ~/.config/fish/config etc.)


An easy solution would be to create an alias named "ls", so instead of the "ls" command you'll be using eza (or exa).


Should you need to revert to the original "ls" command you can do so by typing:

command ls

Here is how you can do it in the bash shell.

echo "alias ls='eza' >> ~/.bashrc'"

If you're using other shells replace ~/.bashrc with the configuration file of your shell.



Common command-line flags


"ls" is a command that can be used with different flags, here's a list of the most common ones.


Most of them are the same of the "ls" command such as:

-a display all the files, including the dotfiles (hidden files by default)

-h display a header row to each column displayed.

-l display the long format of directories and files including permissions, ownership etc.


Some other flags, are specific to "eza" like:

--color=always Instruct eza to always display terminal-colors

--group-directories-first List directories before other files

--icons Display icons next to file names


If you need a specific flag that was not listed here, you can consult the man pages by running:

man eza 

or if you're in Debian and Debian-stable based-distributions type:

man eza


A simple practical use case.

If you would like to display the list of files and folders like the image above, you can use "eza" as follows:

eza -alh --color=always --group-directories-first --icons

and then aliasing the above command as previously shown in "aliasing eza"

echo "alias ls='eza -alh --color=always --group-directories-first --icons' >> ~/.bashrc'"

If you're using other shells replace ~/.bashrc with the configuration file of your shell.



Warning

Eza was previously named "exa".


Some distributions i.e. Debian-stable and Debian-stable-distributions still retain the old binary name.


Replace the correct name in above commands if required.



Icons

If you would like to display file and folder icons in the terminal when using eza, you have to install some fonts, i.e. "Font Awesome" (ithe package is already in the official repo of the main distros) or the "Nerd Fonts" .


11 views0 comments

Recent Posts

See All

Comments


bottom of page