Author Topic: sl - A better ls  (Read 1372 times)

hakerdefo

  • Posts: 520
    • View Profile
    • Looking at Linux through the Windows of Life
sl - A better ls
« 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 and save it somewhere in your $PATH. Also Download sl.tcl, 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'
Code: [Select]
set SWITCH(ignore) 1

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

Code: [Select]
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!!!
You Can't Always Git What You Want

VastOne

  •      v-ger
  • Posts: 3931
    • View Profile
    • VSIDO Community
Re: sl - A better ls
« Reply #1 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!
VSIDO      VSIDO Twitter     VSIDO FB     VSIDO Google+   

I dev VSIDO

hakerdefo

  • Posts: 520
    • View Profile
    • Looking at Linux through the Windows of Life
Re: sl - A better ls
« Reply #2 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'
Code: [Select]
set SWITCH(ignore) 1

I've added this info to the original post.

Cheers!!!
You Can't Always Git What You Want

VastOne

  •      v-ger
  • Posts: 3931
    • View Profile
    • VSIDO Community
Re: sl - A better ls
« Reply #3 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!
VSIDO      VSIDO Twitter     VSIDO FB     VSIDO Google+   

I dev VSIDO

VastOne

  •      v-ger
  • Posts: 3931
    • View Profile
    • VSIDO Community
Re: sl - A better ls
« Reply #4 on: March 27, 2017, 07:24:29 PM »
^ Ignore last post

When editing the correct file, the changes did work!

My bad
VSIDO      VSIDO Twitter     VSIDO FB     VSIDO Google+   

I dev VSIDO

hakerdefo

  • Posts: 520
    • View Profile
    • Looking at Linux through the Windows of Life
Re: sl - A better ls
« Reply #5 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  ;)

Code: [Select]
alias cd='builtin cd "$@"; sl'

Cheers!!!
You Can't Always Git What You Want