rohit746/lsx
A modern ls alternative written in Zig.
-a
flag๐ Documents/ ๐ README.md ๐ผ๏ธ image.png โ๏ธ config.json
๐ src/ ๐ script.sh ๐ต music.mp3 ๐ symlink.txt
Long format:
drwxr-xr-x user staff 128B Jun 14 10:30 ๐ Documents/
-rw-r--r-- user staff 1.2KB Jun 14 09:15 ๐ README.md
-rwxr-xr-x user staff 456B Jun 14 08:45 ๐ script.sh
# Download from GitHub releases
curl -L https://github.com/rohit746/lsx/releases/latest/download/lsx-linux-x86_64 -o lsx
chmod +x lsx
sudo mv lsx /usr/local/bin/
git clone https://github.com/rohit746/lsx.git
cd lsx
zig build -Doptimize=ReleaseFast
sudo cp zig-out/bin/lsx /usr/local/bin/
# List current directory
lsx
# List with hidden files
lsx -a
# Long format with details
lsx -l
# Combine options
lsx -la
lsx [OPTIONS] [PATH...]
Option | Long Form | Description |
---|---|---|
-a |
--all |
Show hidden files and directories |
-l |
--long |
Use long listing format with details |
-S |
--size |
Sort by file size (largest first) |
-t |
--time |
Sort by modification time (newest first) |
-r |
--reverse |
Reverse the sort order |
-p |
--permissions |
Show detailed permissions |
--no-colors |
Disable colored output | |
--no-icons |
Disable file type icons | |
--bytes |
Show exact file sizes in bytes | |
-h |
--help |
Display help information |
# List all files in long format with permissions
lsx -lap
# Sort by size, largest files first
lsx -lS
# Sort by time, newest files first
lsx -lt
# Reverse time sort (oldest first)
lsx -ltr
# Multiple directories
lsx /usr/bin /etc /tmp
# Clean output for scripts
lsx --no-colors --no-icons /path/to/dir
# Debug build
zig build
# Release build
zig build -Doptimize=ReleaseFast
# Run tests
zig build test
# Format code
zig fmt src/
lsx/
โโโ src/
โ โโโ main.zig # Main application logic
โ โโโ root.zig # Core utilities and types
โ โโโ test_main.zig # Unit tests
โ โโโ test_cli.zig # Integration tests
โโโ build.zig # Build configuration
โโโ build.zig.zon # Package manifest
Contributions are welcome! Feel free to:
Please ensure your code is formatted (zig fmt
) and tests pass (zig build test
) before submitting.
This project is licensed under the MIT License - see the LICENSE file for details.
exa
and lsd
Made with โค๏ธ and Zig