Fun Linux Commands That Actually Work (and What They Teach You)

Linux has several fun terminal programs that really work: sl (a steam locomotive for anyone who mistypes ls), cowsay (an ASCII cow says your text), fortune (random quotes), cmatrix (falling green characters), figlet and toilet (large ASCII banners), lolcat (rainbow output) and oneko (a cat that chases your mouse). Most are not installed by default; install them from your package manager.

Jul 23, 2025 - 11:52
Updated: 
102.8k

Linux Administration in IT Infrastructure · Lab / project

Fun Linux Commands That Actually Work (and What They Teach You)

Quick answer: Linux has several fun terminal programs that really work: sl (a steam locomotive for anyone who mistypes ls), cowsay (an ASCII cow says your text), fortune (random quotes), cmatrix (falling green characters), figlet and toilet (large ASCII banners), lolcat (rainbow output) and oneko (a cat that chases your mouse). Most are not installed by default; install them from your package manager. They are a light way to practise pipes, package management and terminal basics. Never run "funny" commands from the internet that you do not understand, because some are destructive jokes.

Key takeaways

  • Fun commands come from packages; installing them teaches package management.
  • Combining them with pipes, as in fortune | cowsay | lolcat, shows how Linux tools chain.
  • Some built-in GNU utilities are surprisingly playful too.
  • Package names differ slightly between distributions.
  • Commands such as rm -rf / or fork bombs are not jokes; never run them.

Table of Contents

Which Fun Commands Work, and How Do You Install Them?

CommandWhat it doesDebian/Ubuntu package
slSteam locomotive crosses the screensl
cowsayASCII cow (or other animals with -f) says textcowsay
fortuneRandom quote or jokefortune-mod (plus fortunes)
cmatrixFalling characters like the filmcmatrix
figlet, toiletLarge ASCII-art textfiglet, toilet
lolcatRainbow-coloured outputlolcat
onekoA cat chases the mouse pointer (graphical desktop)oneko
espeakSpeaks text aloudespeak-ng
# Debian, Ubuntu, Kali
sudo apt update && sudo apt install -y sl cowsay fortune-mod fortunes cmatrix figlet toilet lolcat oneko

# Fedora (names may differ; some need extra repositories)
sudo dnf install -y sl cowsay fortune-mod cmatrix figlet

# Debian puts some games in /usr/games; add it to PATH if needed
export PATH="$PATH:/usr/games"

Check package details on packages.debian.org.

How Do You Combine Them with Pipes?

fortune | cowsay | lolcat                # quote, said by a cow, in rainbow
figlet "WebAsha" | lolcat                # big rainbow banner
cowsay -l                                # list available characters
fortune | cowsay -f tux                  # Tux the penguin says a quote
date | toilet -f term -F border          # boxed date

The pipe | sends one program's output into the next program's input, the core idea of the Unix philosophy.

Which Built-in Commands Are Fun Too?

yes "Linux rocks" | head -5      # yes repeats text forever; head stops it
echo "racecar level" | rev       # reverse characters
factor 2026                      # prime factors: 2026: 2 1013
cal 9 1752                       # September 1752: 11 days missing (calendar change)
shuf -n 1 -e rock paper scissors # random choice

These come from GNU coreutils and util-linux, and work on almost every distribution.

What Does Each One Teach?

CommandConcept
slTypos happen; try sl -e to allow Ctrl+C, learning about signals
fortune | cowsayPipes and standard input/output
cmatrixTerminal capabilities and quitting full-screen apps with q
yes | headInfinite output and how downstream commands close pipes
lolcatANSI colour codes in terminals
Installing them allapt or dnf, PATH, and where binaries live

Which "Funny" Commands Are Dangerous?

Online "jokes" sometimes trick beginners into damaging their systems:

  • rm -rf / or variants: deletes files; modern GNU rm refuses the bare root without --no-preserve-root, but variants still cause damage.
  • Fork bombs written as strings of punctuation: create processes until the system freezes.
  • dd commands writing to /dev/sda: overwrite the disk.
  • Piping unknown URLs into sh: runs whatever the server sends.

Rule: never run a command you cannot explain, especially with sudo. Look it up in the man pages first.

How Do You Add a Fun Login Message?

# Show a cow-delivered fortune each time you open a terminal (bash)
echo 'command -v fortune >/dev/null && fortune | cowsay' >> ~/.bashrc
source ~/.bashrc

Keep it to interactive shells on your own machine, not on shared servers or scripts. For serious tools, see Linux firewalls and Linux users and permissions. WebAsha offers Linux administration courses.

References

Frequently Asked Questions

A joke program that shows a steam locomotive when you mistype ls. Install it with the sl package.

On Debian or Ubuntu run sudo apt install cowsay; on Fedora run sudo dnf install cowsay.

On Debian it lives in /usr/games, which may not be in your PATH. Add it with export PATH=$PATH:/usr/games.

Press q or Ctrl+C to quit and return to your normal terminal prompt.

It pipes a random quote from fortune into cowsay, which displays it in a speech bubble.

The listed programs are harmless. Avoid unknown "funny" commands online, some of which delete data.

A command that creates processes endlessly until the system becomes unresponsive. Never run one.

Yes. Kali is Debian-based, so the same apt package names work.

What's Your Reaction?

Like Like 0
Dislike Dislike 0
Love Love 0
Funny Funny 0
Wow Wow 0
Sad Sad 0
Angry Angry 0
Vaishnavi

Vaishnavi is a skilled tech professional at the Ethical Hacking Training Institute in Pune, responsible for managing and optimizing the technical infrastructure that supports advanced cybersecurity education. With deep expertise in network security, backend operations, and system performance, she ensures that practical labs, online modules, and assessments run smoothly and securely. Her behind-the-scenes contributions play a vital role in delivering a seamless and secure learning experience for aspiring ethical hackers.