A small, pipe-safe alias set for eza.
brew install ezaAdd the aliases below to ~/.zshrc or ~/.bashrc.
# Long views
alias l='eza -blF --git --header --group-directories-first --icons=auto --color=auto'
alias ll='eza -la --git --header --octal-permissions --group-directories-first --icons=auto --color=auto'
alias la='eza -la --git --header --group-directories-first --icons=auto --color=auto'
alias lm='eza -l --git --header --sort=modified --reverse --group-directories-first --icons=auto --color=auto'
# Compact and specialist views
alias l1='eza --oneline --group-directories-first --icons=auto --color=auto'
alias lt='eza --tree --level=2 --group-directories-first --icons=auto --color=auto'
alias l.='eza -a --oneline --color=never | grep -E "^\."'This setup intentionally leaves the system ls command unchanged. If you prefer eza as a direct replacement, add:
alias ls='eza --group-directories-first --icons=auto --color=auto'Then reload the shell configuration:
source ~/.zshrc
# or
source ~/.bashrc-G (--grid) and -l (--long) can be combined. eza calls this its grid-details view. Depending on terminal width, the number of entries, and EZA_GRID_ROWS, it may look the same as a normal long view.
Options such as --header, --git, and -b belong to the long view, so include -l when using them. For example:
eza -blGF --header --gitThe recommended aliases use --color=auto and --icons=auto so redirected or piped output does not contain unwanted terminal formatting.
- Added the missing long-view flag where metadata columns are expected.
- Clarified that grid and long modes can be combined.
- Made colors and icons safe for pipes and redirected output.
- Removed duplicated aliases and corrected the shell code fences.
- Kept the original
lsbehavior unless replacement is explicitly enabled.
Nice, thanks for sharing 🥇