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! 🔥
Homebrew (MacOS and Linux)
brew tap jmattaa/laser
brew install --formula laserClone the repository:
git clone https://github.com/jmattaa/laser.git
cd laserInstall system-wide:
sudo make installTo uninstall you can run
sudo make uninstallAfter installing you can run laser in your current directory by simply running:
lsr
# or for a specific directory run:
lsr some-directoryIf you want to change the colors of the output you can set an environment
variable called LSR_COLORS for example if you want to add nerd font icons to
the existing colors you can use:
export LSR_COLORS="DIR=\x1b[34m :\
SYMLINK=\x1b[36m :\
FILE=\x1b[0m :\
HIDDEN=\x1b[90m :\
EXEC=\x1b[32;4m :\
ARCHIVE=\x1b[31m :\
MEDIA=\x1b[33m :\
DOCUMENT=\x1b[35;3m :"You don't have to change all of these if there is only one you want to change you can do that, to leave the rest on default
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.
-aor--allshows hidden files-Dor--Directoriesshows only directories-For--Filesshows only files-Sor--Symlinksshows only symlinks-Gor--Gitshows only the entries that are not named in.gitignore(works only if there exists a.gitignore)-ror--recursiveshows directory tree structure-ror--recursivehas an optional value for max depth and it can be used by using-r2or--recursive=2by default the depth is until last level
-lor--longdisplays in long format (permissions, last modified, size and owner)
The flags can be chained for example using:
lsr -Dar # this will show all directories including hidden ones recursivly
lsr -GDS # this will only show directories (not hidden) and symlinks that are not mentioned in .gitignoreFeel free to contribute to this project to make it better 🚀 check the CONTRIBUTING.md and follow the guidlines from there!