Note
You can do some cool stuff with the filters, if you have some good filters please reach out and get them showcased. 🔥
lsr basically ls but with colorization and sorting for better readability.
It offers filtering options, making it easy to
locate specific files and folders (with grep you'll find exactly what you need)
It can even display the directory contents in a tree-like structure! 🔥
If that wasn't enough you can even extend the program with lua!
(I'm too proud of that)
Homebrew (MacOS and Linux)
brew tap jmattaa/laser
brew install --formula laserBy installing with Homebrew, you get the shell completions for the cli as well!
AUR (Arch Linux)
yay -S laser-gitClone the repository:
git clone https://github.com/jmattaa/laser.git
cd laserInstall system-wide:
cmake -S . -B build
cmake --build build
sudo cmake --install buildTo uninstall you can run the following while being in the laser directory:
sudo cmake --build build --target uninstallNote
This dosen't install the shell completions for the cli but you can add them
by placing the files from the completions directory in a directory that is
in your $PATH. Or source the file from your bashrc, zshrc or
config.fish file.
After installing you can run laser in your current directory by simply running:
lsr
# or for a specific directory run:
lsr some-directoryIf you'd like to configure the program's behavior, or change the default colors,
add icons and more. You can configure the program with lua 🔥. A default
configuration will be installed at ~/.lsr/. But if you want to
write some own configuration you can place it in ~/.config/lsr/lsr.lua.
Copy the files from ~/.lsr/ to ~/.config/lsr/ and you can edit them (do not
change in the files in the ~/.lsr/ directory because they will be used as
default if there are missing values in the config files).
Check out the configuration guide for more information.
The command-line options can be added by passing flags. These flags can be put before or after the directory you want to search, if there is no directory you can directly pass in the flags.
-
-a/--allDisplays hidden files. -
-D/--DirectoriesDisplays only directories. -
-F/--FilesDisplays only files. -
-S/--SymlinksDisplays only symbolic links. -
-G/--GitCombines the--git-statusand--git-ignoreflags.- Defaults to use the current directory as git repo.
- To specify a Git repository:
-G/path/to/git/repoor--Git=/path/to/git/repo.
-
-g/--git-statusDisplays the Git status of files.- Defaults to use the current directory as git repo.
- To specify a Git repository:
-g/path/to/git/repoor--git-status=/path/to/git/repo. - Lowercase letters as a status means that the file is not staged. And uppercase letters mean that the file is staged.
- Status letters:
A= addedM= modifiedR= renamedT= type changed
-
-i/--git-ignoreDisplays Git-ignored files.- Defaults to use the current directory as git repo.
- To specify a Git repository:
-i/path/to/git/repoor--git-ignore=/path/to/git/repo.
-
-r/--recursiveDisplays the directory tree structure.- Optional depth: Specify a maximum depth with
-r2or--recursive=2. - Default: Expands to the last level.
- Optional depth: Specify a maximum depth with
-
-l/--longDisplays detailed file information, including permissions, last modified date, size, and owner. -
-s/--directory-sizeDisplays the physical disk usage of the all the subdirectories. (will force the-l/--longflag and the-a/--allflag) -
-c/--ensure-colorsEnsures that the output is colorized even if output is redirected to another file than stdout (e.g.lsr > file.txtorlsr | less). -
-n/--no-sortDissables sorting. (The speed difference between sorting and not sorting is really small, got an idea to make it faster? open an issue) -
-fmyfilter/--filter=myfilterApplies a user-defined filter written in Lua.- For more information, see CONFIGURATION.md.
-
-!/--no-luaIgnores the~/.config/lsr/lsr.luafile and runs without user config and user defined filters.
Feel free to contribute to this project to make it better 🚀 check the CONTRIBUTING.md and follow the guidlines from there!