Warning
This project is currently under heavy development and is not yet ready for production use.
The API and implementation may change frequently. Use with caution in non-production environments.
⚡ A blazingly fast
ls
replacement written in Rust
zls (zuedev's ls) is a modern, high-performance replacement for the traditional ls
command. Built with Rust for speed and reliability, it features parallel directory processing, colorized output, and intuitive file type indicators.
- 🚀 Parallel Processing - Leverages Rayon for concurrent directory reading and improved performance
- 🎨 Colorized Output - Visual file type indicators with syntax highlighting
- 📊 Detailed View by Default - Long format displaying file size, modification time, and type
- 📏 Smart Size Formatting - Human-readable sizes (B/K/M/G/T) by default, with raw bytes option
- 🕒 Flexible Sorting - Sort by name (default) or modification time
- 👁️ Hidden File Support - Show/hide dotfiles with
-a
flag - 📱 Responsive Layout - Adapts short format to terminal width
- 🖥️ Cross-Platform - Works on Linux, macOS, and Windows
git clone https://github.com/zuedev/zls.git
cd zls
cargo install --path .
# Build the image
docker build -t zls .
# Run zls in a container
docker run --rm -v $(pwd):/data zls /data
docker pull ghcr.io/zuedev/zls:main
docker run --rm -v $(pwd):/data ghcr.io/zuedev/zls:main /data
zls [OPTIONS] [PATH]
Flag | Long Form | Description |
---|---|---|
-a |
--all |
Show hidden files (starting with . ) |
-s |
--short |
Use compact listing format with column layout |
-t |
--time |
Sort by modification time (newest first) |
-H |
--human |
Show human-readable sizes (default: enabled) |
--bytes |
Show raw byte sizes instead of human-readable | |
-h |
--help |
Print help information |
-V |
--version |
Print version information |
# List current directory (detailed view)
zls
# List with hidden files
zls -a
# Compact view sorted by modification time
zls -st
# Show raw byte sizes
zls --bytes
# List specific directory
zls /usr/local/bin
d 4.1K Dec 25 10:30 src/
- 1.2K Dec 25 10:25 Cargo.toml
- 8.5K Dec 25 10:29 main.rs
Format: [type] [size] [modified] [name]
- Type:
d
for directory,-
for file - Size: Human-readable by default (B/K/M/G/T)
- Modified:
MMM DD HH:MM
format - Name: Color-coded by file type
src/ Cargo.toml main.rs target/ README.md
Responsive column layout that adapts to terminal width.
zls uses parallel processing via Rayon to read directory entries concurrently, making it significantly faster than traditional ls
for directories with many files. The performance improvement is most noticeable with:
- Large directories (100+ files)
- Network-mounted filesystems
- Directories with mixed file types
cargo test
# Run all benchmarks
cargo bench
# Run specific benchmark group
cargo bench format_size
cargo bench directory_reading
cargo bench sorting
The benchmark suite includes:
- Size formatting - Performance comparison between human-readable and raw byte formatting
- Time formatting - Date/time string formatting performance
- File info creation - FileInfo struct creation from filesystem metadata
- Directory reading - Sequential vs parallel directory processing comparison
- Sorting - Name vs modification time sorting performance
Benchmark results are saved to target/criterion/
with detailed HTML reports.
# Debug build
cargo build
# Release build
cargo build --release
The project includes comprehensive unit tests covering:
- Size formatting (human-readable and raw bytes)
- Time formatting and edge cases
- File type detection (hidden files, directories)
- Size conversion edge cases
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
- clap (4.0+) - Command-line argument parsing
- crossterm (0.27) - Cross-platform terminal manipulation and colors
- rayon (1.7) - Data parallelism library
- chrono (0.4) - Date and time handling
This project is open source and dedicated to the public domain under the Unlicense.