An alternative to the ls command - eza command

I came across the cli library called eza which is a much better version of the standard ls command used to list files and folders in your current directory.

eza-1.png

Install in Linux (Ubuntu)

Go to the eza.rocks website and you will see methods to install eza for various linux distributions. This install guide will be or Debian / Ubuntu.

Install the GPG encryption tool as it's required to install eza.

sudo apt install -y gpg

The next group of commands will install eza.

sudo mkdir -p /etc/apt/keyrings
wget -qO- https://raw.githubusercontent.com/eza-community/eza/main/deb.asc | sudo gpg --dearmor -o /etc/apt/keyrings/gierens.gpg
echo "deb [signed-by=/etc/apt/keyrings/gierens.gpg] http://deb.gierens.de stable main" | sudo tee /etc/apt/sources.list.d/gierens.list
sudo chmod 644 /etc/apt/keyrings/gierens.gpg /etc/apt/sources.list.d/gierens.list
sudo apt update
sudo apt install -y eza

Run the version command to see if eza is working.

eza

If the files/folders for the current directory output then the command is working.

Install in MacOS

Make sure that brew is installed.

Use the install command to add it.

brew install eza

Try running eza to make sure it works.

eza

Commands

I’ve replaced the ls command to use eza instead as it's a much better version. Here are the commands I use to set it up.

This will show a list of files/folders separated by a space.

alias ls="eza"

eza-2.png

This will show a list of files/folders on each line with extra information.

alias ll="eza --group --header --group-directories-first --long"

eza-3a.png

This command lists each file/folder per line, adds headers, re-orders list by folders then files and shows the git status of each file.

If you want to see all the commands you can use with eza then they are all available by going to the github page and clicking the Command-line options link.