eza — modern ls
💬 "The eza Command"
eza is a Rust-based command that modernizes the classic ls. It displays colors, icons, git status, and tree structure all in one view.
By using the standard ls options while providing more information, it significantly reduces the need for server file exploration.
- Concept: Outputs directory listings in a visually rich format.
- Default ls Replacement: Displays the same list as
ls -lbut in a more readable format. - --long: Shows detailed permissions, owner, size, and date.
- --tree: Expands subdirectories into a tree structure.
Installation and Download
eza can be installed via a package manager or Rust cargo. Servers (Debian/Ubuntu) use apt, while development machines can use cargo or brew.
| Environment | Command |
|---|---|
| Ubuntu / Debian | sudo apt install eza |
| Fedora / RHEL | sudo dnf install eza |
| Arch | sudo pacman -S eza |
| macOS (brew) | brew install eza |
| Rust cargo | cargo install eza |
| Binary Download | github.com/eza-community/eza/releases |
Verify the installation with eza --version. For older distribution versions, the package may not be available, so use cargo or release binaries.
Frequently Used Options
| Option | Description |
|---|---|
| -l | Displays a detailed listing (permissions, owner, size) |
| -a | Shows hidden files as well |
| --tree | Outputs the substructure in a tree format |
| --git | Shows the git change status of files |
| --sort=modified | Sorts by last modified date |
3 Essential Command Combinations
eza -l— View permissions, size, and date details at a glance.eza --tree --level=2— Visualize the folder structure as a tree up to 2 levels deep.eza -l --sort=modified | head— List recently modified files first in detail.
💬 "Show me an example of checking a directory on a real server."
Here is a step-by-step breakdown of a common scenario encountered on a live server.
Step 1 · Verify Installation
First, check if it is installed, and if not, install it.
eza --version || sudo apt install -y eza
Step 2 · Inspect Web Root in Detail
View permissions and owner together.
eza -l /var/www/html
Step 3 · Understand Folder Structure
Check the tree structure up to 2 levels deep.
eza --tree --level=2 /var/www/html
Actual Execution Output
This is the result of listing the web root in detail using eza after installation. Permissions, owner, and size are displayed with colors.
!eza command execution result: detailed web root listing after installation
Live production server
In Practice, It's Used Like This
1. Finding Recently Modified Files
Situation — Locating a deployment file that was just uploaded.
eza -l --sort=modified /var/www/html | head -5
Result — Files with the most recent modification dates appear at the top.
Key Point — Sorting by time is easily done with sort=modified.
2. Getting an Overview of a Project Structure
Situation — Understanding the folder structure of a project you're opening for the first time.
eza --tree --level=2 --git
Result — The tree structure and git-modified files are displayed together.
Key Point — Limiting the depth with level prevents the output from overflowing.
Actual Execution Output
This is the result of viewing files sorted by most recently modified.
!eza command execution result: sorting by recently modified files
Live production server
Points to Note
- eza requires separate installation (via apt, brew, cargo, etc.).
- Older distribution versions may not have the apt package, so use cargo or a binary.
- If an existing
lsalias remains, eza might execute first, so be cautious. - When --tree is expanded deeply, the output can be long, so use it with
head. - When replacing
lswithezain scripts, check for option compatibility.
Source (HTML): https://games.aidebatehub.com/programs/linux/modern/eza.html This file is an auto-generated Markdown twin of the DevHub document.
AI Knowledge Hub
Visitor Comments