6 ms·
Sl: a steam locomotive in your terminal
- Argorak 14y agoI highly recommend the debian bug tracker on `sl`: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=614158 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=614158 Also, for those that love their cars "pre-tuned by german engineers", there is `gti`: http://r-wos.org/hacks/gti http://r-wos.org/hacks/gti
- _delirium 14y agoThere are some nice closed bugs too. Here is an argument over whether it should support ^C by default: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=598992 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=598992
- frankblizzard 14y agofirst saw this thing around 12 years ago on an AS/400 terminal. Our neckbearded Lead Programmer was supposed to have programmed it in RPG but probably this thing is even older?
- Argorak 14y agoThe source downloaded from the authors page[1] lists the following modification times: [ skade sl ] ls -la * -rw-r--r-- 1 skade staff 331 Jul 22 1998 Makefile -rw-r--r-- 1 skade staff 417 Jul 22 1998 README -rw-r--r-- 1 skade staff 689 Jan 18 1994 sl.1 -rw-r--r-- 1 skade staff 7.0K Jul 22 1998 sl.c -rw-r--r-- 1 skade staff 4.1K Jan 18 1994 sl.h -rw-r--r-- 1 skade staff 980 Jan 18 1994 sl.txt So, it is almost 20 years old. [1] http://www.tkl.iis.u-tokyo.ac.jp/~toyoda/index_e.html http://www.tkl.iis.u-tokyo.ac.jp/~toyoda/index_e.html
- gee_totes 14y agoI've always wondered: why is it a locomotive? Why not a penguin or something else? Just thinking aloud here: ls stands for 'list'.... so sl stands for 'tsil'.... which is a model of a train? No, that's not it. I think there's a missing part to this joke. [edit] Just stepped away from my desk and took two steps and figured it out: sl = steam locomotive
- deleted 14y ago[deleted]
- jurre 14y agosl, steam locomotive.
- pifflesnort 14y agoRegarding the penguin: sl(1) was originally written in 1992; Linux itself didn't hit 1.0 until 1994, and the Linux penguin itself wasn't introduced until 1996.
- Oompa 14y agoI added this to Homebrew years ago, for those OS X users.
- ihuman 14y agoIt is also in MacPorts
- Ogre 14y agoI just installed it, thanks! Also, brew seems to have added a beer mug emoji to the terminal output when it finishes installing something since the last time I installed anything. I didn't know the terminal (Actually iTerm 2 in this case) even supported that. Neat!
- Blahah 14y agoWhen a colleague accidentally types their password to our cluster into a chat window, the first thing I do is login as them and alias ls=sl. Another fun one is to add `telnet towel.blinkenlights.nl` to their .bashrc, so on login they get to watch ascii star wars.
- benhalllondon 14y agoGreat, excellent, fun. But, clearly, it should run 'ls' after doing its choo choo?
- rmk2 14y agoWell, this forces you to type 'ls' again, giving you another chance to see the awesome locomotive! ;)
- minos 14y agoOne could use a shell alias, a function or something similar for that.
- ricket 14y agoalias sl='sl;ls'
- cliffbean 14y agoThat is optimizing for the short term. "When I've run sl, I clearly wanted ls, so you should give me that (even if you also punish me)." Optimizing for the long term is also plausible. "Don't reward me for making mistakes (even if you also punish me) because it'll dilute my muscle-memory training, and I'll be more likely to make mistakes in the future." Neither of these is inherently more correct than the other. The long term has more uncertainty, but greater potential rewards. We just have to make a judgment call. I tend to favor the long-term approach for sl. I can't easily quantify how valuable my stricter muscle-memory training will be, but I can imagine the possibility of a significant upside if I actually become a more precise typer. Also, the worst-case downside just isn't that bad -- retyping ls just isn't that hard.
- philwelch 14y agoThe Unix philosophy is that a program should only do one thing. sl only does one thing.
- Mindless2112 14y agoWhy alias commands to sl? The point is for it to be triggered on bad typing. Also, the man page is worth a look -- http://manpages.ubuntu.com/manpages/precise/man6/sl.6.html http://manpages.ubuntu.com/manpages/precise/man6/sl.6.html
- davidroberts 14y agoI just installed it on my Raspberry Pi. It's in the Raspian repository too!
- rdtsc 14y agoBonus info: if you add arguments to sl like -l or -a you get a different locomotive or other effects!
- jzoidberg 14y agoWe need one for "got"
- kmf 14y agoDelivered. https://github.com/imkmf/got https://github.com/imkmf/got
- Watabou 14y agoOkay that is freaking awesome. I now have GoT's theme playing in the terminal. This may actually make me misspell git even more.
- fnordfnordfnord 14y agoGot, Got Milk?, Displays Got Milk? Advert. Boring GOThic, Changes terminal font to Gothic? GoT, Game of Thrones, Decapitates user?, Automatically fires up BitTorrent client and grabs latest episode? Plays ASCII art GoT episode? Cat's all of GRRM's GoT novels into your terminal? (That'll teach you).
- jaxb 14y agoA shitogram for modern age.
- barkingcat 14y agoon os x - brew install sl brings it in.
- ggreer 14y agoVeteran: "You should apt-get install sl." Newbie: "What does sl do?" Veteran: (perfectly straight face) "It trains you."
- captn3m0 14y agoThe moving train uses js for motion. I stripped that part to http://jsbin.com/ujizup/1 http://jsbin.com/ujizup/1
- nuclear_eclipse 14y agoOn the Sun/Solaris machines where I first worked, the `sl` command had an added bonus: it played a really loud "choo-choo" sound from the workstation's internal speaker, regardless of volume or mute settings, so you always knew when someone fat-fingered their file listings, and much laughing was had by all. I very quickly learned to alias sl=ls in my shell rc, and it's still in there to this day, just in case...
- prezjordan 14y agoHow did you get this in the main repositories? I'm curious what the process is for something like that.
- blablabla123 14y agoAccording to someone else's comment this thing is at least 20 years old. AFAIK these things go by popularity, after all any sort of game is also non-productive...
- laumars 14y ago> The following code changes the default behaviour of ls from listing > files to turning your terminal into an unstoppable steam locomotive. > The only way to end it is closing the terminal, so use this with caution. erm, that's easily stopped: [ctrl]+z $ pkill -9 sl
- eridius 14y ago^Z will just suspend `sl`, at which point bash will immediately launch another copy. That's what the loop is for.
- jlgreco 14y agoHave you actually tried it? In neither zsh nor bash does this seem to actually be the case.
- eridius 14y agoWell no, because I didn't want to install `sl`. But it looks like you're right. I just tried `while true; do ( echo hi; sleep 1; echo bye; ); done` and ^Z does stop the cycle.
- jlgreco 14y agoInterestingly, at least how I have zsh configured and don't have bash configured, the behavior of `fg` after suspending these is different. With zsh when I resume the execution it continues looping. However with bash it resumes for only one more iteration.
- eridius 14y agoYeah I would have expected `fg` to continue the loop, but it doesn't. If I put `echo $?` after the subshell in that loop, it doesn't even print when I run `fg`. It's like bash just throws away the loop entirely when I suspend the subshell.
- niggler 14y ago"Note: I actually didn't use a marquee for this. The one good use for one, and I missed it. Damn." Is this even a good example for using html marquee?
- mbubb 14y agoNot the same thing but "apt-get moo" on a Debian based box is fun...
- adimitrov 14y agoThe one bad thing about switching to the Dvorak layout is that in Dvorak, ls is really cumbersome to type. The l isn't on the home-row, and both of them are on the right pinky. The way I do it now, it's virtually impossible to type sl instead of ls. Typing dc instead of cd, though is still very common. And dc just mockingly tells me: "will not attempt to process directory." (I now have `no` aliased to ls. Maybe I should alias `on` to sl.)
- nilsbunger 14y agoIf you're on a Mac with homebrew, "brew install sl" will get you there!
- systematical 14y agohad to apt-get sl
- mostly_harmless 14y agoalternatively if you are really evil, you can 'alias ls="rm -rf"'
- dogface 14y agoOh come on! This isn't news. I was using sl fifteen years ago.
- orvtech 14y agoI did a little video on this a couple of weeks a go with a mini how to for Fedora users https://news.ycombinator.com/item?id=4766611 https://news.ycombinator.com/item?id=4766611