Skip to main content

eza — Modern Replacement for ls

eza is a modern, actively maintained replacement for ls.

It improves directory listing by adding:

  • Better colors
  • Optional file icons
  • Git status integration
  • Built-in tree view
  • Clearer long-format tables
  • Flexible sorting and time formatting

If you frequently use ls -la, tree, or inspect Git repos on a WordPress VPS, eza can replace all of them in one tool.

1. Installation

Install (Ubuntu/Debian)

sudo apt install eza

Verify

eza --version

2. Core Syntax

eza [OPTIONS] [FILES...]

If no path is given, it lists the current directory.

3. Main Views

eza supports three primary output modes:

Grid View (Default)

eza

Compact column layout (like ls).

Long View (-l)

eza -l

Shows:

  • Permissions
  • Owner
  • Group
  • Size
  • Timestamp

Add headers:

eza -l --header

Tree View

eza --tree

Recursive directory tree.

Limit depth:

eza --tree -L 2

4. Most Important Flags (Practical Set)

Show Hidden Files (-a)

eza -a

Equivalent to ls -a.

Long View with Header (Best Default)

eza -la --header

Recommended daily audit view.

Show Git Status

eza -l --git

Adds Git column showing:

  • Modified
  • Untracked
  • Staged files

Perfect for:

wp-content/themes
wp-content/plugins

Group Directories First

eza --group-directories-first

Shows folders before files.

Sort by Size

eza -l --sort=size --reverse

Largest first.

Useful for:

wp-content/uploads

Sort by Modified Time

eza -l --sort=modified

Newest files first.

Relative Time Display

eza -l --time-style=relative

Displays:

2h ago
3d ago

Very useful during incident response.

Exact Bytes

eza -l --bytes

Precise size values.

Only Directories

eza --only-dirs

Navigation-focused listing.

Only Files

eza --only-files

File-only listing.

Ignore Noise

eza --ignore-glob 'node_modules|vendor|cache'

Removes clutter.

Icons (Requires Nerd Font)

eza --icons

Adds file-type icons.

Install a Nerd Font if icons appear broken.

eza --hyperlink

Clickable paths in supported terminals.

5. WordPress VPS Workflows

Audit WordPress Root

eza -la --header /var/www/html

See:

  • .htaccess
  • wp-config.php
  • Ownership
  • Permissions

Spot Large Uploads

eza -l --sort=size --reverse /var/www/html/wp-content/uploads

Find large files immediately.

Inspect Plugins Structure

eza --tree -L 2 /var/www/html/wp-content/plugins

Better alternative to tree.

Review Theme Git Status

eza -l --git /var/www/html/wp-content/themes

See modified/untracked files instantly.

Show Recently Modified Files

eza -l --sort=modified --time-style=relative /var/www/html

Helpful for:

  • Detecting suspicious changes
  • Post-update verification

Backup Directory Inspection

eza -l --bytes /home/backups

Exact backup sizes.

6. Recommended Aliases

Add to .bashrc or .zshrc:

alias ls='eza'
alias ll='eza -l --header'
alias la='eza -la --header'
alias lt='eza --tree -L 2'

Reload shell:

source ~/.bashrc

7. Benefits Over ls

Featurelseza
---
Colored outputBasicAdvanced
Git statusNoYes
Tree viewNoYes
Header rowNoYes
Flexible time stylesLimitedExtensive
IconsNoYes

8. Best Practices

  • Use -la --header as your default audit view.
  • Combine --sort=size --reverse to find heavy directories.
  • Use --tree -L 2 instead of deep recursive listings.
  • Use --time-style=relative during debugging.
  • Install a Nerd Font for clean icon display.
  • Avoid full-depth --tree on massive directories.

9. Troubleshooting

ProblemCauseFix
--
Icons not showingFont missing glyphsInstall Nerd Font
Colors missing in pipeNot a TTYAdd --color=always
Output too noisyToo many filesUse --ignore-glob or -L
Timestamps confusingWrong formatUse --time-style=iso

10. Compact Cheat Sheet

eza # Grid
eza -la --header # Long view with hidden + headers
eza -l --git # Git-aware listing
eza --tree -L 2 # Tree (2 levels)
eza -l --sort=size --reverse
eza -l --sort=modified
eza -l --time-style=relative
eza --only-dirs
eza --ignore-glob 'vendor|cache'
eza --icons

11. Summary

eza replaces:

  • ls
  • ls -la
  • tree
  • Basic Git status scans

In WordPress VPS management, it becomes your:

  • Permission auditor
  • Upload size inspector
  • Plugin/theme Git monitor
  • Quick tree visualizer

It keeps familiar ls behavior while adding modern capabilities.

Mini Knowledge Check

  1. Which flag adds headers to long view?
  2. How do you limit tree depth to 2 levels?
  3. Which option shows Git status?
  4. How do you display relative time like “2h ago”?
  5. Why might icons not display correctly?