Linux / UNIX Desktop Fun: Steam Locomotive – get train in shell

One of the most common mistake is typing sl instead of ls command. I actually set an alias i.e. alias sl=ls; but then you may miss out the steam train with whistle.

sl is a joke software or classic UNIX game. It is a steam locomotive runs across your screen if you type “sl” (Steam Locomotive) instead of “ls” by mistake. sl is a highly advanced animation program for curing your bad habit of mistyping. In other words, you see Steam locomotive in ASCII art.

Install sl software to get Steam Locomotive ( train in shell )

Type the following apt-get command/apt command on a Debian / Ubuntu Linux:
$ sudo apt-get install sl

Run the following yum command on a CentOS/RHEL (first enable EPEL repo on a RHEL/CentOS version 6 or version 7 of CentOS/RHEL or enable and install ELEP repo on RHEL 8 or install EPEL repo on CentOS 8):
$ sudo yum install sl
Type the following dnf command on a Fedora Linux:
$ sudo dnf install sl
Execute the following brew command on a macOS Unix desktop (see how to install Homebrew on macOS):
$ brew install sl
Run the following pkg_add command on a OpenBSD:
# pkg_add -v sl
FreeBSD user type the following pkg command:
# pkg install sl
Arch Linux user try the pacman command$ sudo pacman -S sl
OpenSUSE or SUSE Linux user try installing sl using the zypper command:
$ sudo zypper in sl

Usage

Okay, just mistyped ls command as sl:
$ sl
Run steam locomotive  i.e. get a train in shell when you type sl
Another run:

sl command in action

sl command in action

It also supports the following options:

  • -a : An accident seems to happen. You’ll feel pity for people who cry for help.
  • -l : shows little one.
  • -F : It flies.
  • -e : Allow interrupt by Ctrl+C.

For extra fun try the following little bash for loop along with lolcat command:

## tested on macOS only ##
for i in a l f o
do
 sl -${i} | lolcat
done

Do check the following help pages using the help command or man command:
$ man sl
$ sl --help

sl command Linux

sl command in Linux

Conclusion

And there you have it, sl displays animations (train in shell) aimed to correct users who accidentally enter sl instead of ls for fun and profit. If you enjoyed this desktop fun app, you may also like to use the following apps on Linux:

Did you find this article useful?