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.
Hyperlinks
eza --hyperlink
Clickable paths in supported terminals.
5. WordPress VPS Workflows
Audit WordPress Root
eza -la --header /var/www/html
See:
.htaccesswp-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
| Feature | ls | eza |
|---|---|---|
| -- | - | |
| Colored output | Basic | Advanced |
| Git status | No | Yes |
| Tree view | No | Yes |
| Header row | No | Yes |
| Flexible time styles | Limited | Extensive |
| Icons | No | Yes |
8. Best Practices
- Use
-la --headeras your default audit view. - Combine
--sort=size --reverseto find heavy directories. - Use
--tree -L 2instead of deep recursive listings. - Use
--time-style=relativeduring debugging. - Install a Nerd Font for clean icon display.
- Avoid full-depth
--treeon massive directories.
9. Troubleshooting
| Problem | Cause | Fix |
|---|---|---|
| - | - | |
| Icons not showing | Font missing glyphs | Install Nerd Font |
| Colors missing in pipe | Not a TTY | Add --color=always |
| Output too noisy | Too many files | Use --ignore-glob or -L |
| Timestamps confusing | Wrong format | Use --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:
lsls -latree- 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
- Which flag adds headers to long view?
- How do you limit tree depth to 2 levels?
- Which option shows Git status?
- How do you display relative time like “2h ago”?
- Why might icons not display correctly?