Skip to content

eza

eza is a modern alternative to ls.

🛠 Installation

sudo apt 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
brew install eza

⚙ Config

eza is backeard compatible with ls so you can add to your bash aliases and map it to ls.

~/.bashrc

# Check if command exists
function command_exists(){
  command -v "${1}" &> /dev/null
}

if command_exists eza; then
  alias ls='eza'
fi
source ~/.bashrc

📝 Usage

Here are some common ways to use eza, demonstrating its features beyond the standard ls.

Show detailed long view, all files (including hidden), with a header

eza -la --header

Display files as a tree (limited to 2 levels deep)

eza --tree --level=2

Tip

Requires a Nerd Font to render icons

A common alias: long format, all files, icons, and Git status

eza -la --icons --git

Sort by file size, largest first

eza -l --sort=size --reverse

🔗 References