Skip to main content

8 open source 'Easter eggs' to have fun with your Linux terminal

Hunt these 8 hidden or surprising features to make your Linux experience more entertaining.
Image
Photo of a broken pink egg with smaller eggs spilling out

In technology terms, an Easter egg is a hidden message or feature in a piece of software that, when triggered, prints or does something inoffensive and fun. In many cases, these messages credit someone for their work or pay tribute to a person or a piece of art like a novel or a movie. In other cases, it's just a hidden message that requires a special circumstance to be triggered.

Although Easter eggs are usually hidden and undocumented, for this article I am using a looser definition that includes terminal programs that are fun and may surprise you if you're not familiar with them.

1. Vim knows…

The Vim text editor knows the answer to the Meaning of Life. If you also want to know it, open Vim, then type :help 42 and see for yourself.

Alternatively, you can launch Vim straight into that help page:

vim  +h42

This is Vim's way to pay homage to the classic comedy science fiction novel The Hitchhiker's Guide to the Galaxy by the late Douglas Adams.

This Easter egg also works in Neovim.

2. Try Ansible Cowsay

The program cowsay is a popular fun Linux command that generates ASCII art of a cow "saying" anything the user inputs when calling it. This program is so popular that I do not even consider it to be an Easter egg.

But what you may not know is, if you have cowsay installed on your computer and you run an Ansible playbook on the command line, Ansible uses it to print the task names for a fun and surprising output:

$ ansible-playbook playbook.yaml

< PLAY [Test playbook] >
 ----------------------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||

 __________________________
< TASK [Print Hello World] >
 --------------------------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||

ok: [localhost] => {
    "msg": "Hello World!"
}
 ____________
< PLAY RECAP >
 ------------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||

localhost   : ok=1 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0

[ How well do you know Linux? Take a quiz and get a badge. ]

3. Learn from your mistakes

If you're around the Linux or Unix terminal for a while, you've probably mistyped the command ls as sl many times when trying to list the contents of your directory. This is inoffensive and not too annoying; just retype the command and move on.

This experience changes if you install a nifty little program called sl:

sudo dnf install -y sl

The next time you make that mistake, you see a fun steam locomotive cross your terminal:

4. Play Emacs games

Among the many many things you can do with the Emacs text editor, you can also play games! To see a list of available games, list the contents of directory /usr/share/emacs/*/lisp/play:

$ cd /usr/share/emacs/*/lisp/play
$ ls *.elc
5x5.elc       decipher.elc    gamegrid.elc   life.elc       spook.elc
animate.elc   dissociate.elc  gametree.elc   morse.elc      studly.elc
blackbox.elc  doctor.elc      gomoku.elc     mpuz.elc       zone.elc
bubbles.elc   dunnet.elc      handwrite.elc  snake.elc
cookie1.elc   fortune.elc     hanoi.elc      solitaire.elc

To play one of these games, start Emacs, press Esc + x to execute a program, and type the name of the game you want to play:

M-x 5x5

+--------------------------+
| .... .... .... .... .... |
| .... .... .... .... .... |
| .... .... .... .... .... |
| .... .... #### .... .... |
| .... .... #### .... .... |
| .... .... #### .... .... |
| .... #### #### #### .... |
| .... #### #### #### .... |
| .... #### #### #### .... |
| .... .... #### .... .... |
| .... .... #### .... .... |
| .... .... #### .... .... |
| .... .... .... .... .... |
| .... .... .... .... .... |
| .... .... .... .... .... |
+--------------------------+
On: 5  Moves: 0

Some of these games are interesting, so give them a try!

[Cheat sheet: Old Linux commands and their modern replacements. ]

5. Get more color in your life

Is your terminal dull and monochromatic?

Image
Monochromatic terminal output
(Ricardo Gerardi, CC BY-SA 4.0)

The little program lolcat can fix that. Install it:

sudo dnf install -y lolcat

Then use it on a file or pipe the output of any program to lolcat for a more colorful experience:

Image
Colorful terminal output with lolcat
(Ricardo Gerardi, CC BY-SA 4.0)

6. Set your terminal on fire

Well, not really, but using aafire, you can see the effects of an ASCII flame animation on your terminal:

Image
aafire - Terminal Flames
(Ricardo Gerardi, CC BY-SA 4.0)

You can also combine that with lolcat for colorful flames:

Image
Colorful terminal flames with aafire and lolcat
(Ricardo Gerardi, CC BY-SA 4.0)

7. Transform your terminal into an aquarium

If instead of flames, you prefer something more peaceful, asciiaquarium transforms your terminal into a lively aquarium with a variety of aquatic life and a few surprises:

Image
Terminal aquarium with asciiaquarium
(Ricardo Gerardi, CC BY-SA 4.0)

8. Explore the zen of Python

Python hides a few Easter eggs. One of them is "The zen of Python," a list of 19 guiding principles to make your Python programming more effective. If you don't know or don't remember them, open a Python interactive session and type import this to see that list:

$ python
Python 3.11.2 (main, Feb  8 2023, 00:00:00) [GCC 12.2.1 20221121 (Red Hat 12.2.1-4)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import this
The Zen of Python, by Tim Peters

Beautiful is better than ugly.
Explicit is better than implicit.
Simple is better than complex.
Complex is better than complicated.
Flat is better than nested.
Sparse is better than dense.
Readability counts.
Special cases aren't special enough to break the rules.
Although practicality beats purity.
Errors should never pass silently.
Unless explicitly silenced.
In the face of ambiguity, refuse the temptation to guess.
There should be one-- and preferably only one --obvious way to do it.
Although that way may not be obvious at first unless you're Dutch.
Now is better than never.
Although never is often better than *right* now.
If the implementation is hard to explain, it's a bad idea.
If the implementation is easy to explain, it may be a good idea.
Namespaces are one honking great idea -- let's do more of those!
>>>

Collect all the eggs

Your Linux terminal doesn't have to be monochromatic and boring. Try these 8 Linux Easter eggs and add some color and fun to your command line.

[ Want to test your sysadmin skills? Take a skills assessment today. ]

Topics:   Linux   Command line utilities  
Author’s photo

Ricardo Gerardi

Ricardo Gerardi is Technical Community Advocate for Enable Sysadmin and Enable Architect. He was previously a senior consultant at Red Hat Canada, where he specialized in IT automation with Ansible and OpenShift.  More about me

Try Red Hat Enterprise Linux

Download it at no charge from the Red Hat Developer program.