LX: A nicer way to list your files
A modern alternative to ls with more readable formatting, colours, icons, and customizable output.
Features
- Crazy fast: just as fast (if not faster) compared to the stock
lscommand - Colorized output with file type icons
- Multiple display modes: short (default), long (
-l), one-per-line (-1), compact (-c), and recursive tree view (-r) - Configurable: customise colours, hidden-file styling, spacing, display options, and tree styles
- Smart alignment: properly handles unicode characters and icons
Demo
Basic formatting difference compared to the standard ls command
Nicer long format compared to the standard ls command (displayed fields can be customized)
Recursive sub-directory tree view with the -r flag
The -r flag can be combined with the '-l' long flag for viewing subdirectory info
-1 flag to force single-column output formatting
Requirements
- Rust 1.85 or newer and Cargo
- Either a nerd font or a terminal like Ghostty which has nerd font icons pre-installed.
Installation
The easiest way to install lx is using Cargo:
This will install the lx binary to ~/.cargo/bin/, which is typically already in your PATH.
Alternatively, you can build it from source:
For local development, use the provided install script to automatically build and install:
This script will build the project and copy the binary to ~/.local/bin/.
Make sure ~/.local/bin is in your PATH:
Add this to your shell configuration file (.bashrc, .zshrc, etc.) to make it permanent.
Quick Start
After installation, simply run:
Usage
lx is used pretty much just like regular old ls:
# List files in current directory
# List files in long format
# Show hidden files
# Display one file per line
# Use compact columns, wrapping after five rows by default
# Show directory tree recursively
# Show only directories or only files
# Exclude names or glob patterns from a listing
# Sort by size, largest first
# Combine flags
# List files in a specific directory
Flags
-l,--long: Use a long listing format with detailed file information-a,--all: Show all files, including hidden ones (starting with.)-f,--files: Show only files (not available with-r)-d,--directories: Show only directories (not available with-r)-x,--exclude <PATTERN>: Exclude comma-separated names or*/?glob patterns; repeat the flag to add more patterns-s,--sort <FIELD> [ORDER]: Sort byname,size,modified,type,permissions,links,owner, orgroup; use optionalasc(the default) ordesc--sort-order <ORDER>: Explicit alternative for specifyingascordesc; requires--sort-1: Force single-column output (useful for piping to other commands)-c,--compact: Use compact columns, wrapping aftercompact_max_rowsrows-r,--recursive: Show directory tree recursively with proper hierarchy
-l and -1 are treated as separate display modes, so they cannot be combined together. -c is only available for short output, so it cannot be combined with -l, -1, or -r. Short flags can still be clustered in the usual Unix style, so combinations like -la, -lr, and -alr work as expected.
Configuration
lx can be customized using a configuration file at ~/.config/lx/config.
See config.example for all available options and detailed configuration examples.
Configuration Sections
The configuration file supports the following sections:
[colors]: Customise text colours for different file types, including hidden files[icons]: Set custom icons for different file types[icons.colors]: Customise colours for icons separately from filenames, including hidden file icons[display]: Control layout options, column wrapping, and default sorting[display.tree]: Control tree display style for recursive listings (style = "ascii"orstyle = "indent")
Set datetime_format under [display] to change the long-format modified column. It uses Chrono’s strftime-style specifiers, so %B %-d, %Y renders a full month name (for example, August 8, 2026) and %-I:%M %p uses a 12-hour clock. Numeric and text directives are padded independently across the listing, keeping each date/time component aligned.
For a complete list of available colors, icons, and configuration options, please refer to config.example.