“lls” is a little “ls” alternative
If you ever wondered why the hell command “ls” does not color the output or why doesn’t it show directories first, or why does it screws the filenames with spaces, that renders it unusable for scripts, then I understand you.
The beauty of linux systems is that you are free to fix and tweak everything yourself (well, of course that does mean you should learn how to do it first:). My long-term discontent with “ls” was enough for me to think about making something customized enough to suit my needs. So this is how I started to write a script.
The first version was quite ugly slow and couldn’t do much but silly entertain its author. With the help of my guru co-worker, that re-factored my code and taught me how I should use functions properly) it became something of a useful tool for me. It was later I found out that there was an alternative like ls++ (an awesome app!). Still the script was done and then I decided to use another benefit of linux world — sharing. Here I am.
Some words about “whats that stuff do?”. The script “lls” shows directory content in alphabetical order (not a big invention, heh?:), with directories coming first. It colors the output so that you can easily locate executable, readable or writable files. In addition, it can add more info on each file.
The script can filter executable, archived, text, video and audio files, which is one damn useful function, if you ever happened to cd into a Download directory file ocean. The filtering function do not depend on .extensions, so even some “system_folder”
xxx video file will be declassified in no time)
One of my favourites is a “–tree” function that draws pretty trees of directories with a number of files in them (check it out!).
“lls” is indeed a handy script, just download it and put somewhere in your $PATH.
This is it. I hope you enjoy it as much as I do, and maybe some of you will feel a pleasant content of alternative and freedom of choice, that linux world gives us
Script itself –> http://lls.googlecode.com/files/lls
Archlinux AUR package –> https://aur.archlinux.org/packages.php?ID=53735
Note: Ubuntu/Debian users may need little correction, like changing “#!/bin/sh” to “#!/bin/bash”
Filed under: scripts | Leave a Comment
Tags: alternative, bash, linux, open-source, shell