How To Have Fun in Terminal: Cool Linux Commands

How To Have Fun in Terminal: Cool Linux Commands
Photo by Nayam / Unsplash

The next commands will, probably, not do something very useful, but we all need to relax sometimes and share cool stuff with friends, kids or just random people around. Surprisingly, some software I'm trying to highlight here is complex and has taken a lot of the authors time.

1. sl - cure your bad habit of mistyping ls. Super cool animated locomotive, the source code is here.

$ sl

sl command demo

2. cowsay - interactively talking with cow, literally:

 __________________
< srsly dude, why? >
 ------------------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||

And this cow is even configurable! You can change text, eyes, tongue and more:

  text: 'hello',
  cow: '', // Template for a cow, get inspiration from `./cows`
  eyes: 'oo', // Select the appearance of the cow's eyes, equivalent to cowsay -e
  tongue: 'L|', // The tongue is configurable similarly to the eyes through -T and tongue_string, equivalent to cowsay -T

Source code can be found here.

3. yes - never say no, just like Jim Carrey in the movie Yes Man:

$ yes "Never say 'no'"
Never say 'no'
Never say 'no'
...

4. rev - reverse any string:

$ rev
ls
sl
linux
xunil
mint
tnim

5. figlet - nice ASCII-art:

$ figlet -f slant "Sudo I Love You"

   _____           __         ____   __                       __  __
  / ___/__  ______/ /___     /  _/  / /   ____ _   _____      \ \/ /___  __  __
  \__ \/ / / / __  / __ \    / /   / /   / __ \ | / / _ \      \  / __ \/ / / /
 ___/ / /_/ / /_/ / /_/ /  _/ /   / /___/ /_/ / |/ /  __/      / / /_/ / /_/ /
/____/\__,_/\__,_/\____/  /___/  /_____/\____/|___/\___/      /_/\____/\__,_/

6. factor - decompose number to prime factors:

$ factor 11234
11234: 2 41 137

> 2*41*137
11234

7. Generate a poignant, inspirational, silly or snide sentence from fortune:

$ fortune
Who dat who say "who dat" when I say "who dat"?
		-- Hattie McDaniel

$ fortune
Personality Tithe:
	A price paid for becoming a couple; previously amusing
human beings become boring: "Thanks for inviting us, but Noreen and I
are going to look at flatware catalogs tonight.  Afterward we're going
to watch the shopping channel."
		-- Douglas Coupland, "Generation X: Tales for an Accelerated
		   Culture"

$ fortune
Twenty two thousand days.
Twenty two thousand days.
It's not a lot.
It's all you've got.
Twenty two thousand days.
		-- Moody Blues, "Twenty Two Thousand Days"

Source code is here.

8. ASCII Star Wars with telnet, nearly 20 minutes(!) long:

$ telnet towel.blinkenlights.nl

                                   /~\
         R2-D2!                   |oo )
     Where are you?         #     _\=/_    #
                             \\  /  _  \  //
                              \\//|/.\|\\//
                               \/  \_/  \/
                                  |\ /|
                                  \_ _/
                                  | | |
                                  | | |
                                  []|[]
                                  | | |
  _______________________________/_]_[_\______________________

9. Typewriter simulator with pv (pause after every character):

$ echo "The Nix Sanctuary" | pv -qL 10

10. Playing with man command:

$ man man > man

This command prints the manual of man command (the manual of manual utility) to man text file.

11. Fork Bomb - please don't run this command on your production machines:

$ :(){ :|:& }:

12. Man mages can also be funny. And even be called funny-manpages:

# apt-get install funny-manpages
$ man baby

DESCRIPTION
baby is initiated when one parent process polls another server process through a socket connection in the BSD version or through pipes in the System V implementation. baby runs at low priority for approximately forty weeks and then terminates with a heavy system load. Most systems require constant monitoring when baby reaches its final stages of execution.

Older implementations of baby did not require both initiating processes to be present at the time of completion.

13. Make love, not war:

$ make love
make: *** No rule to make target 'love'.  Stop.

No rule yet, please write it as your personal.

14. Cmatrix - the Matrix screen in terminal

$cmatrix

cmatrix

15. banner - print nice banner from text characters:

$ banner "Linux"

#        ###  #     #  #     #  #     #
#         #   ##    #  #     #   #   #
#         #   # #   #  #     #    # #
#         #   #  #  #  #     #     #
#         #   #   # #  #     #    # #
#         #   #    ##  #     #   #   #
#######  ###  #     #   #####   #     #

16. "Mooo" with apt-get and aptitude:

$ apt-get moo
         (__)
         (oo)
   /------\/
  / |    ||
 *  /\---/\
    ~~   ~~
...."Have you mooed today?"...

$ aptitude moo
There are no Easter Eggs in this program.
$ aptitude -v moo
There really are no Easter Eggs in this program.
$ aptitude -vv moo
Didn't I already tell you that there are no Easter Eggs in this program?
enlightened@enlightened:~$ aptitude -vvv moo
Stop it!
$ aptitude -vvvv moo
Okay, okay, if I give you an Easter Egg, will you go away?
$ aptitude -vvvvv moo
All right, you win.

                               /----\
                       -------/      \
                      /               \
                     /                |
   -----------------/                  --------\
   ----------------------------------------------
$ aptitude -vvvvvv moo
What is it?  It's an elephant being eaten by a snake, of course.

17. aafire - fire in the console:

aafire

ASCII art flames will make you feel better on cold evening next February.

18. asciiview - view any image in ASCII-mode:

$ asciiview photo.jpg -driver curses

asciciew

19. Give your display a bit of rainbow colors with lolcat:

$ grep -o --binary-files=text '[[:alpha:]]' /dev/urandom |tr -d '[a-zA-Z]' |xargs -n $(($COLUMNS/2)) |tr -d ' '| lolcat -f | pv -L80k

lolcat

20. Rainbows in your terminal with the yes and printf commands:

$ yes "$(seq 231 -1 16)" | while read i; do printf "\x1b[48;5;${i}m\n"; sleep .02; done

21. A dictionary in console:

$ curl dict://dict.org/d:love
220 pan.alephnull.com dictd 1.12.1/rf on Linux 3.14-1-amd64 <auth.mime> <250092.29125.1438257995@pan.alephnull.com>
250 ok
150 3 definitions retrieved
151 "Love" gcide "The Collaborative International Dictionary of English v.0.48"
Love \Love\ (l[u^]v), n. [OE. love, luve, AS. lufe, lufu; akin
   to E. lief, believe, L. lubet, libet, it pleases, Skr. lubh
   to be lustful. See {Lief}.]
    1.A feeling of strong attachment induced by that which
      delights or commands admiration; pre["e]minent kindness or
      devotion to another; affection; tenderness; as, the love
      of brothers and sisters.
      [1913 Webster]

            Of all the dearest bonds we prove
            Thou countest sons' and mothers' love
            Most sacred, most Thine own.          --Keble.
      [1913 Webster]

22. Multiplication tables for kids:

$ for i in {1..9}; do for j in $(seq 1 $i); do echo -ne $i×$j=$((i*j))\\t; done; echo; done
1×1=1
2×1=2	2×2=4
3×1=3	3×2=6	3×3=9
4×1=4	4×2=8	4×3=12	4×4=16
5×1=5	5×2=10	5×3=15	5×4=20	5×5=25
6×1=6	6×2=12	6×3=18	6×4=24	6×5=30	6×6=36
7×1=7	7×2=14	7×3=21	7×4=28	7×5=35	7×6=42	7×7=49
8×1=8	8×2=16	8×3=24	8×4=32	8×5=40	8×6=48	8×7=56	8×8=64
9×1=9	9×2=18	9×3=27	9×4=36	9×5=45	9×6=54	9×7=63	9×8=72	9×9=81

23. man mount command:

$  man mount woman
No manual entry for woman

24. TELEHACK - simulation of a stylized ARPANET/Usenet, circa 1985-1990. It is a full multi-user simulation, including 25,000 hosts and BBS's early net, collection of adventure and IF games, a working BASIC interpreter with a library of programs to run, simulated historical users, and more.

$ telnet telehack.com
Trying 64.13.139.230...
Connected to telehack.com.
Escape character is '^]'.

Connected to TELEHACK port 59

It is 5:37 am on Thursday, July 30, 2015 in Mountain View, California, USA.
There are 34 local users. There are 24906 hosts on the network.

May the command line live forever.

Command, one of the following:
  ?           ac          advent      basic       cal         calc
  ching       clear       clock       cowsay      date        echo
  eliza       factor      figlet      finger      fnord       geoip
  help        hosts       ipaddr      joke        login       md5
  morse       newuser     notes       octopus     phoon       pig
  ping        primes      privacy     rain        rand        rfc
  rig         roll        rot13       sleep       starwars    traceroute
  units       uptime      usenet      users       uumap       uupath
  uuplot      weather     when        zc          zork        zrun

.eliza
HELLO, I AM ELIZA.
roll

DO GO ON.

25. ZOMBIEMUD - text-based online role playing game:

$ telnet zombiemud.org
Trying 85.23.80.184...
Connected to zombiemud.org.
Escape character is '^]'.
      Welcome to ...
          ___                       __     __) __     __) ______
         (,   )          /)  ,     (, /|  /|  (, /   /   (, /    )
             / ______   (/_     _    / | / |    /   /      /    /
           _/_(_) // (_/_) _(__(/_) /  |/  |_  /   /     _/___ /_
       )   /                     (_/   '      (___(_   (_/___ /
      (__ /
                 ... online since 1994.

      There are currently 55 mortals and 8 wizards online.

	    Give me your name or choose one of the following:

	    [C]reate a new character     [W]ho is playing
	    [V]isit the game             [S]tatus of the game
	    [D]isconnect

            Your choice or name:

Read more