VSIDO Community

VSIDO Support => Scripts and How To's => Scripts => Topic started by: hakerdefo on March 27, 2017, 06:22:35 PM

Title: sl - A better ls
Post by: hakerdefo on March 27, 2017, 06:22:35 PM
We being the terminal junkies use cli environment as much as possible and 'ls' is one of the essential tool we use to list files and directories.
Now here comes 'sl'. I call it a better ls. It's a simple script so nothing to install. Just Download sl (http://vsido.org/index.php?action=dlattach;topic=1291.0;attach=479) and save it somewhere in your $PATH. Also Download sl.tcl (http://vsido.org/index.php?action=dlattach;topic=1291.0;attach=480), a sample configuration file, and save it with the name '.sl.tcl' in your $HOME directory.

To view the hidden files you'll need to add the following line to the config file '.sl.tcl'

set SWITCH(ignore) 1


And yes 'sl' has a single dependency that you can easily install like this,


sudo apt-get install tcl


That's it! Next time you want to use 'ls' just do 'sl' and I'm confident you'll love it  8)

The original intent of this post is to serve as the place-holder of this wonderful script as the original website is gone!

Cheers!!!
Title: Re: sl - A better ls
Post by: VastOne on March 27, 2017, 06:33:57 PM
^ Another very nice find..

Couple of things.. The sl script needs to be made an executable and tcl is already standard on VSIDO (just an FYI)

I noticed it does not by default show hidden files.. Is this a config setting to do or are there options with the script?

Great job!   8)

Cheers!
Title: Re: sl - A better ls
Post by: hakerdefo on March 27, 2017, 07:16:49 PM
Nicely spotted Vasty  8)
By default 'sl' let the hidden files remain, well err, hidden  :D
This is to avoid cluttering the output.

However one can easily override this to view the hidden files. Just add the following to the config file '.sl.tcl'

set SWITCH(ignore) 1


I've added this info to the original post.

Cheers!!!
Title: Re: sl - A better ls
Post by: VastOne on March 27, 2017, 07:22:08 PM
^ thanks... I added that and resourced bashrc and tried several different lines in the tcl file but am still not seeing hidden files.. it is no worries.. I have a ls alias that does just that for me

One (me) should always check to edit the correct file and not the original downloaded file

Thank you!
Title: Re: sl - A better ls
Post by: VastOne on March 27, 2017, 07:24:29 PM
^ Ignore last post

When editing the correct file, the changes did work!

My bad
Title: Re: sl - A better ls
Post by: hakerdefo on March 27, 2017, 07:54:09 PM
It happens  :D

And here is some bonus for the fans of aliases  8)
VastOne is one of them  ;)


alias cd='builtin cd "$@"; sl'


Cheers!!!