ls vs eza | which is more efficient and performant ?

ยท 906 words ยท 5 minute read

ls is a command in the famous coreutils. It can be found on all POSIX-compliant operating system shells. The ls command is meant to list directory contents. Its codebase is written in C and it’s very old.

eza is a modern commandline application which aims to replace ls. It is written in Rust programming language. The creator of eza claims that it is small and fast in the official code repository on Github .

Let’s test if it is faster on macOS and Ubuntu Linux.

Installing eza on macOS ๐Ÿ”—

I installed eza on my macbook pro via homebrew with this command.

brew install eza

eza vs ls on macOS ๐Ÿ”—

timing ls & eza in fish shell ๐Ÿ”—

$ time ls
Executed in    6.25 millis    fish           external
   usr time    1.62 millis    0.50 millis    1.12 millis
   sys time    4.62 millis    2.23 millis    2.39 millis

ls took 6.25 ms to execute. Let’s see eza!

$ time eza
Executed in   15.19 millis    fish           external
   usr time    6.09 millis    0.09 millis    6.00 millis
   sys time    5.79 millis    1.68 millis    4.11 millis

Oops. eza took 15.19 ms to execute. ls is more than 2X faster than eza.

Let’s test the each one of them with the long output/info.

$ time eza -l
________________________________________________________
Executed in   14.61 millis    fish           external
   usr time    6.58 millis    0.11 millis    6.48 millis
   sys time    8.04 millis    1.81 millis    6.23 millis

$ time ls -l
Executed in    8.46 millis    fish           external
   usr time    2.12 millis    0.48 millis    1.65 millis
   sys time    4.82 millis    2.03 millis    2.79 millis

ls is still 1.7X faster than eza in the long output/info.

timing ls & eza in zsh shell ๐Ÿ”—

$ time ls
ls  0.00s user 0.00s system 78% cpu 0.003 total

$ time eza
eza  0.01s user 0.00s system 75% cpu 0.014 total

ls is more than 4X faster than eza in ZSH shell.

Installing eza on Ubuntu Linux 24.04 LTS ๐Ÿ”—

I installed eza on my Linux HP laptop via APT with this command.

sudo apt install -y eza

eza vs ls on Ubuntu Linux ๐Ÿ”—

timing ls & eza in Fish shell ๐Ÿ”—

$ time eza
________________________________________________________
Executed in    5.88 millis    fish           external
   usr time    2.19 millis    0.00 micros    2.19 millis
   sys time    3.77 millis  485.00 micros    3.29 millis

$ time ls
________________________________________________________
Executed in    2.20 millis    fish           external
   usr time    0.34 millis  342.00 micros    0.00 millis
   sys time    1.93 millis  233.00 micros    1.70 millis

On Linux, ls is more than 2X faster than eza with default config.

Let’s time the long output.

$ time ls -l
________________________________________________________
Executed in    3.63 millis    fish           external
   usr time    1.82 millis  864.00 micros    0.96 millis
   sys time    1.92 millis    0.00 micros    1.92 millis

$ time eza -l
________________________________________________________
Executed in   11.46 millis    fish           external
   usr time    4.18 millis  411.00 micros    3.77 millis
   sys time    7.53 millis    0.00 micros    7.53 millis

ls is 3X faster than eza.

timing eza vs ls in Bash shell ๐Ÿ”—

Bash shell is the default shell on Ubuntu 24.04 LTS.

$ time eza
real 0m0.006s
user 0m0.002s
sys 0m0.004s

$ time ls
real 0m0.003s
user 0m0.000s
sys 0m0.002s

Actually, ls is 3X faster than eza on Ubuntu Linux when using Bash shell.

other programs ๐Ÿ”—

There are too many commandline programs that aim to replace ls and tree. Here are some of them.

  • eza: the program we where talking about all that post.
  • lsd : It is named LSDeluxe, written in Rust, has ~13K stars on Github.
  • colorls : A Ruby gem that beautifies the terminal’s ls command, with color and font-awesome icons.
  • ls-go : A more colorful, user-friendly implementation of ls written in Go.
  • g: powerful and cross-platform ls ๐ŸŒˆ built for modern terminal. ls-g is written in Go .
  • natls : ls alternative with useful info and a splash of color. It is written in Rust.
  • logo-ls : Modern ls command with vscode-like File Icon and Git Integrations. Written in Golang.

Evaluation ๐Ÿ”—

ls is consistently faster than eza in all benchmarks we did. So, if you want to choose the faster, it is clearly the ls program pre-installed on your machine.

But eza went too far and offered icons for files and directories like this.

$ eza -l --icons 
.rw-r--r-- 25M mbp  1 Jul 05:01 ๎˜‹ core_formulas.json
.rw-r--r-- 198 mbp 31 Jul 03:34 ๎™ž go.mod
.rw-r--r-- 896 mbp 31 Jul 03:32 ๎™ž go.sum
.rwxr-xr-x 10M mbp  1 Aug 15:29 ๏€– gobrew
.rw-r--r-- 13k mbp 31 Jul 03:31 ๎™ž main.go
.rw-r--r-- 15k mbp  2 Jul 11:43 ๏’Š readme.md

and offered a tree-like output.

$ eza -TL2
.
โ”œโ”€โ”€ app
โ”‚  โ”œโ”€โ”€ build
โ”‚  โ”œโ”€โ”€ build.gradle
โ”‚  โ”œโ”€โ”€ proguard-rules.pro
โ”‚  โ”œโ”€โ”€ release
โ”‚  โ””โ”€โ”€ src
โ”œโ”€โ”€ build
โ”‚  โ”œโ”€โ”€ kotlin
โ”‚  โ””โ”€โ”€ reports
โ”œโ”€โ”€ build.gradle
โ”œโ”€โ”€ gradle
โ”‚  โ””โ”€โ”€ wrapper
โ”œโ”€โ”€ gradle.properties
โ”œโ”€โ”€ gradlew
โ”œโ”€โ”€ gradlew.bat
โ”œโ”€โ”€ local.properties
โ”œโ”€โ”€ README.md
โ””โ”€โ”€ settings.gradle

So if you like a more vibrant colorful output, go with eza.

If you’d like to have tree-view with the same command instead of using ls and tree, go with eza.

If you would like to have neat icons before each file and directory, choose eza instead of ls.

I hope you enjoyed reading this post as much as I enjoyed writing it. If you know a person who can benefit from this information, send them a link of this post. If you want to get notified about new posts, follow me on YouTube , Twitter (x) , LinkedIn , and GitHub .

Share:
waffarx cash back