LinuxCommandLibrary

eza

List directory contents with improved formatting

TLDR

List files one per line

$ eza [[-1|--oneline]]
copy

List all files, including hidden files
$ eza [[-a|--all]]
copy

Long format list (permissions, ownership, size and modification date) of all files
$ eza [[-al|--all --long]]
copy

List files with the largest at the top
$ eza [[-r|--reverse]] [[-s|--sort]] [size]
copy

Display a tree of files, three levels deep
$ eza [[-lT|--long --tree]] [[-L|--level]] [3]
copy

List files sorted by modification date (oldest first)
$ eza [[-l|--long]] [[-s|--sort]] [modified]
copy

List files with their headers, icons, and Git statuses
$ eza [[-lh|--long --header]] --icons --git
copy

Don't list files mentioned in .gitignore
$ eza --git-ignore
copy

SYNOPSIS

eza [OPTIONS] [FILE...]

PARAMETERS

-l, --long
    Display a long listing format, showing detailed file information (permissions, user, group, size, date, etc.).

-a, --all
    Do not ignore entries starting with '.' (hidden files and directories).

-F, --classify
    Append an indicator to entries: '*' for executables, '/' for directories, '@' for symlinks, '|' for FIFOs, and '=' for sockets.

-T, --tree
    Recurse into directories and display the contents as a hierarchical tree. Combine with -L for depth limit.

-G, --git
    Show Git status for each file or directory (e.g., modified, new, untracked, ignored).

--icons
    Display file type icons next to file names for better visual identification, requiring a Nerd Font enabled terminal.

--color=WHEN
    Control when to use color: 'always', 'auto' (default, uses color if terminal supports), or 'never'.

-s, --sort=WORD
    Sort the output by a specified word, e.g., 'name', 'size', 'type', 'time', 'inode', 'extension'.

-S, --sort-size
    Sort by file size, largest first. Equivalent to '--sort=size'.

-r, --reverse
    Reverse the order of the sort, making smallest first for size or Z-A for name.

-i, --inode
    Show the inode number of each file or directory.

--extended
    Show extended attributes and SELinux contexts (if present) alongside regular permissions.

--hyperlink
    Display file paths as clickable hyperlinks in supported terminals (e.g., Kitty, iTerm2).

-g, --group-directories-first
    List directories before files, then sort by name within each group. This can be combined with other sorting options.

DESCRIPTION

eza is a contemporary command-line file lister, designed as a robust and visually enhanced alternative to the traditional ls. Written in Rust for speed and safety, it offers numerous improvements over its predecessor, including built-in Git status integration, display of file type icons, detailed file information (like inode, blocks, extended attributes), a recursive tree view, and various display formats (long, grid, across). It aims to provide a more intuitive and informative directory listing experience, leveraging color and formatting to highlight crucial details and streamline command-line navigation.

It's designed to be a faster, more user-friendly, and more powerful tool for browsing directories and files, making it a popular choice for developers and power users.

CAVEATS

While eza is an excellent ls replacement, it may not be a 100% drop-in for all shell scripts or aliases that rely on very specific ls output parsing or obscure options. Users transitioning from ls should test existing scripts that process directory listings. It also needs to be explicitly installed as it's not part of the standard core Unix/Linux utilities.

CUSTOMIZATION WITH ENVIRONMENT VARIABLES

eza primarily uses environment variables for extensive customization, such as controlling colors (e.g., EZA_COLORS) and icon sets (e.g., EZA_ICONS, EZA_ICONS_AUTO). This allows for highly personalized visual output without relying on traditional configuration files like .ezarc.

COMMON USAGE PATTERN

Many users alias ls to eza or eza -l in their shell configuration (e.g., alias ls='eza' or alias ll='eza -l') to seamlessly integrate it into their workflow and immediately benefit from its enhanced features, making it their default directory lister.

HISTORY

eza originated as a fork of exala (which was itself a fork of lsd), a modern ls alternative written in Rust. The project was created to provide more active maintenance, resolve long-standing issues, and introduce new features beyond the scope of its predecessor. It has quickly gained popularity as a robust and feature-rich directory listing utility, maintaining a strong focus on performance and user experience and becoming a successor to earlier modern ls efforts.

SEE ALSO

ls(1), lsd(1), tree(1), dircolors(1)

Copied to clipboard