Skip to content

Fun Terminal Commands for Linux and macOS

Every other page on this site is about getting work done faster. This one isn’t. It covers the commands that exist because somebody with a compiler and a free weekend thought a cow should be able to talk, and the several decades of Unix users who agreed.

They are not useful. They are, however, a decent way to learn pipes: almost all of them read standard input and write standard output, so they snap together like the serious tools do, only the result is a dragon reading out your last commit message. Nearly every one below has a Try it button that types it into a real Linux machine in this page, so you can find out which ones you like before installing any of them.

Command What it does Quit with
cowsay A cow (or a dragon, or Tux) says your text —
fortune A random quotation, joke or aphorism —
figlet Big letters made of small letters —
lolcat Rainbows. Everything, rainbows —
boxes Draws a box around text, and takes it off again —
sl A steam locomotive, for when you meant ls Waiting. That’s the joke
cmatrix The falling green code from The Matrix q
asciiquarium An aquarium, with fish, ducks and the odd shark q
pipes.sh The Windows 3D Pipes screensaver, flattened any key
cbonsai Grows a bonsai tree, slowly, while you watch q
nyancat The Pop-Tart cat, rainbow and all, with a timer Ctrl+C
fastfetch Your system specs next to a distro logo —
genact Fake compiler output, so you look busy Ctrl+C

The first five print something and exit, which makes them pipeline material. The rest take over the screen until you tell them to stop, apart from sl, which ignores you.

And if you’d rather not install anything at all, a few need only curl or nc: Star Wars, the weather and a dancing parrot, courtesy of somebody else’s server.

A cow, a speech bubble, and whatever you hand it. Tony Monroe wrote cowsay in Perl in 1999, and it has been in every distro’s repositories, and a good many people’s .bashrc, ever since.

Terminal window
cowsay "Moo. Obviously."
_________________
< Moo. Obviously. >
-----------------
\ ^__^
\ (oo)\_______
(__)\ )\/\
||----w |
|| ||

cowthink is the same cow, thinking rather than saying. -f picks a different animal, and cowsay -l lists what’s installed: Tux, a dragon, a stegosaurus, a koala and about forty others.

Terminal window
cowthink -f tux "Did I leave the stove on?"
___________________________
( Did I leave the stove on? )
---------------------------
o
o
.--.
|o_o |
|:_/ |
// \ \
(| | )
/'\_ _/`\
\___)=(___/

The cow’s face is configurable too. -e sets the eyes and -T the tongue, and there are shortcuts for the moods: -d dead, -p paranoid, -s stoned, -t tired, -w wired, -y young, -b Borg and -g greedy.

Terminal window
cowsay -d "This is fine"
______________
< This is fine >
--------------
\ ^__^
\ (xx)\_______
(__)\ )\/\
U ||----w |
|| ||

Long text gets wrapped at 40 columns. -W changes the width, and -n turns wrapping off altogether, which you’ll want for anything that’s already laid out (a table, a figlet banner, another cow).

Install: brew install cowsay · sudo apt install cowsay · sudo dnf install cowsay.

Catch: some installs include a handful of cows you won’t want on a shared screen. Debian moves them into a separate cowsay-off package, and the playground leaves them out. Homebrew and Fedora ship a newer fork, cowsay 3.8, which takes the same flags. On Debian and Ubuntu, cowsay lives in /usr/games, which is on a normal user’s PATH but not root’s, so sudo cowsay reports that it doesn’t exist. This is the only sense in which cowsay is secure.

Prints a random quotation, joke or bit of mock wisdom from a database of thousands, and has done since Version 7 Unix in 1979. It’s the other half of the most famous pipeline in Unix:

Terminal window
fortune | cowsay
_______________________________________
/ Finagle's First Law: \
| |
| If an experiment works, something has |
\ gone wrong. /
---------------------------------------
\ ^__^
\ (oo)\_______
(__)\ )\/\
||----w |
|| ||

fortune -s sticks to short ones, which suit a cow better than a three-paragraph anecdote about FORTRAN. Name a database to draw from just that one, and fortune -f lists them; the playground’s copy has startrek, zippy, two general-purpose sets and, inexplicably, a single recipe.

Terminal window
fortune -s startrek

Install: brew install fortune · sudo apt install fortune-mod · sudo dnf install fortune-mod.

Catch: Debian’s fortune-mod brings only a small starter database. sudo apt install fortunes gets the full set. The “offensive” databases, which live up to the name, are in fortunes-off, and not in the playground.

Turns text into banners made of ordinary characters. FIGlet dates from 1991, and the name stands for Frank, Ian and Glenn’s letters. It’s still the standard way to put a big title at the top of a script’s output, a README, or a server’s login message.

Terminal window
figlet -f slant terminal.ninja
__ _ __ _ _
/ /____ _________ ___ (_)___ ____ _/ / ____ (_)___ (_)___ _
/ __/ _ \/ ___/ __ `__ \/ / __ \/ __ `/ / / __ \/ / __ \ / / __ `/
/ /_/ __/ / / / / / / / / / / / /_/ / /_ / / / / / / / / / / /_/ /
\__/\___/_/ /_/ /_/ /_/_/_/ /_/\__,_/_/(_)_/ /_/_/_/ /_/_/ /\__,_/
/___/

-f picks the font. standard, slant, small, big, banner, block, script and shadow come with it, and figlet -I2 prints the directory they’re in, so you can look for more. -c centres the output, and -w sets the width it wraps at, which defaults to 80 columns and will chop a long word into a second line without asking.

Install: brew install figlet · sudo apt install figlet · sudo dnf install figlet.

Catch: none worth mentioning, unless you count toilet: the same idea with colour filters (toilet -F metal, toilet -F border), and a name that makes searching the web for help with it more of an adventure than it needs to be. It’s in Homebrew, Debian and Fedora, but not Alpine, so not the playground.

Reads text and writes it back out in a rainbow. That’s the whole program. Put it at the end of any of the pipelines on this page and it gets better, or at least more colourful.

Terminal window
fortune -s | cowsay | lolcat
Terminal window
figlet -f slant terminal.ninja | lolcat -b
Terminal window
__ _ __ _ _
/ /____ _________ ___ (_)___ ____ _/ / ____ (_)___ (_)___ _
/ __/ _ \/ ___/ __ `__ \/ / __ \/ __ `/ / / __ \/ / __ \ / / __ `/
/ /_/ __/ / / / / / / / / / / / /_/ / /_ / / / / / / / / / / /_/ /
\__/\___/_/ /_/ /_/ /_/_/_/ /_/\__,_/_/(_)_/ /_/_/_/ /_/_/ /\__,_/
/___/

It’s also a quick check of your terminal’s colour support. With 24-bit colour the rainbow is a smooth gradient; with 256 colours, which is lolcat’s default in its C version, you can see the steps. If you’ve asked for 24-bit and still see steps, or the colours go strange inside tmux or over SSH, something between lolcat and the screen is misreporting what the terminal can do, and the truecolor guide explains what.

Install: brew install lolcat · sudo apt install lolcat · sudo dnf install lolcat.

Catch: there are two lolcats, and their flags don’t agree. Homebrew and Debian install the original Ruby gem; Fedora and Alpine (so the playground) install a C rewrite that’s quicker to start. The Ruby one switches to 24-bit colour when COLORTERM=truecolor is set, or with -t; the C one wants -b. Ruby’s -a animates the rainbow, and the C one has no animation at all. And -h is help in one and “horizontal frequency” in the other. Plain lolcat, with no flags, works the same everywhere.

Draws a box around text. There are 69 designs, from plain ASCII through a parchment scroll and a cat to Tux, and boxes -l lists the lot.

Terminal window
echo "rm -rf / --no-preserve-root" | boxes -d stone
+-----------------------------+
| rm -rf / --no-preserve-root |
+-----------------------------+

The novelty wears off fairly quickly. Then you notice it knows comment syntax: -d c-cmt writes C comments, -d shell hash comments, and -r takes a box off again. Pipe a selection through it from your editor and it boxes and unboxes comment blocks for you, which is more than can be said for the rest of this page.

Terminal window
printf 'TODO: fix this\nproperly, later\n' | boxes -d c-cmt
/* TODO: fix this */
/* properly, later */

Install: brew install boxes · sudo apt install boxes · sudo dnf install boxes.

Catch: the realisation, an hour later, that every comment in the file is now in a box.

Type ls too quickly and you get sl, so somebody made sl a steam locomotive that crosses your screen. Toyoda Masashi wrote it in 1993, as a punishment.

Terminal window
sl

The punishment is the point: sl ignores Ctrl+C, so you sit and watch the whole train go by. In the playground that’s about nine seconds, and longer in a wider window. -l makes it a little train, -F makes it fly, and -a causes an accident, with passengers calling for help.

Install: brew install sl · sudo apt install sl · sudo dnf install sl.

Catch: Debian and Ubuntu patch in -e, which lets Ctrl+C through. The tldr page lists it as if everyone has it, but it isn’t in the original, and the playground’s sl is the original: no way out at all.

The green rain from The Matrix, falling down your terminal until you press q. It was written by Chris Allegretta, who also wrote GNU nano, so the same person gave the world its friendliest text editor and its least productive screensaver.

Terminal window
cmatrix
Terminal window
( 5 < Z M a ) s D m V . i - 1 ^ - 6 U l @ : * V
6 a r # i < % 6 0 9 S \ n a e z / L I n K o
+ , C m J Q R # = c l X + o @ ! > s n 4 d
9 A N g < w r d v . 1 k ; r A M $ _ 1 e 8 )
T S ! B / 8 4 c / * H q Y c . d ] o k R
+ w $ i g H U R / 5 E n R w ] ? x s D
G Y X % H G U ? C d F r ' + 6 $ 2 a E C
; \ a . ` s 9 Y % w G v 5 S 3 v a X [
) h @ f B > % ) _ > E [ N , ` V ( " w M f
+ & W r > _ ; \ b : z + e $ u ? + F ^ >
W @ : = v M l a Q % - D , d " J 0 L % Q D
_ I H U 1 b ) G 1 q n k n . v H S P u % > > & l
u H m L c 7 f \ = n ' ; 5 e Q 8 . u u E " h I
( N y ; w t * p l < = 7 Q q U s H : ' M v d v # x

-r makes the rain rainbow, -C picks another colour (cmatrix -C blue), and -s is screensaver mode, which quits on any key. -u sets the delay between frames, from 0 to 10; lower is faster.

Install: brew install cmatrix · sudo apt install cmatrix · sudo dnf install cmatrix.

Catch: -c uses the film’s Japanese katakana, but only if your font has them. Most programming fonts don’t, so you get a screen full of boxes.

An aquarium: fish of several sizes, seaweed, a castle, bubbles, and now and then a shark that eats the smaller fish. Written by Kirk Baucom in Perl, and endlessly calming to have running in a spare pane.

Terminal window
asciiquarium
Terminal window
| | |
)_) )_) )_)
)___))___))___)\
)____)____)_____)\\
_____|____|____|____\\\__
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\ /~~~~~~
^^^^ ^^^ ^^^ ^^^ ^^^^ ^^^^ ^^^ ^^^ ^^^ ^^^^ ^^^^ ^^^ ^^^
^^^^ ^^^^ ^^^ ^^ ^^^^ ^^^^ ^^^ ^^ ^^^^ ^^^^
^^ ^^^^ ^^^ ^^^^^^ ^^ ^^^^ ^^^ ^^^^^^ ^^ ^^^^
T~~
|
/^\
/ / \
,../... _ _ _ / \ _ _ _
/ '\ / [ ]_[ ]_[ ]/ _ __ \[ ]_[ ]_[ ]
< ' ) =< |_=__-_ =_|_[ ><_'>_.:/-___-__|
) \ \ / \ | _- = | =_ = _,,///;, ,;/
( `'\'"'"' ) |= -[] |- = _o:::::::;;/// |
) ) ( | =_ |= - >::::::::;;\\\ |
)( ( ) |= []- |- /| ''\\\\\'' ';\|
( ) ) ( |- =_ | =| |(| | |- = - |
)( ( ) |_______|__|_| )_|__|_______|

Install: brew install asciiquarium · sudo dnf install asciiquarium.

Catch: Debian and Ubuntu don’t package it, so it’s the script from the author’s site and the Term::Animation module from CPAN. And in the playground, the fish are in no particular hurry: it’s Perl, on an emulated Pentium III, so you get about seven frames a second. On a real machine they swim properly.

The Windows 3D Pipes screensaver, in two dimensions and bash. Coloured pipes snake across the screen, turning at random, until it fills up and starts again. Any key stops it.

Terminal window
pipes.sh -p 3

-p sets how many pipes draw at once, -t picks one of ten pipe styles (0 to 9), and -R starts each one somewhere random.

Install: brew install pipes-sh · sudo apt install pipes.sh. Elsewhere, it’s one bash script to drop on your PATH.

Catch: it’s bash, redrawing the screen one character at a time, so it uses more CPU than a screensaver about pipes has any right to.

Grows a bonsai tree in your terminal: branches, leaves and a pot, different every time.

Terminal window
cbonsai -l
Terminal window
&
& &&&
& &&&&&&/&
&&&&&&| &&&&
&&&&&&~&&&|/&
&&&&&&&&&&|&
&&&&&|\&/
& /|&~|/&\& &&
/|&\|&&&&&&
& /|\|/|\|&&&&&&
&& && \||//|\|&&& &
&&&&|&/|\|//~|\&&&&&&&
&& &&&_\||/ //~&&&&&_&&&&&
& /\| /_/__/&_/ && && &
/~/|/|\&_/ &
\_/&&& _/& & &&
//~~ &__&&&&&
|//~|\ &&&&& &
/~|\/~ &&
|/~~|
/~| \/~
/~//~
:___________./~~~\.___________:
\ /
\_________________________/
(_) (_)

-l is live mode, which draws the tree as it grows; without it you just get the finished tree, which misses the point. -i grows one after another forever, -m adds a message, and -p prints the tree and quits rather than leaving it on screen, so it can go at the top of a login.

Terminal window
cbonsai -p -m "Ship it"

Install: brew install cbonsai · sudo apt install cbonsai · sudo dnf install cbonsai.

Catch: every tree is random, so the good one you just grew is gone for good unless you pass a seed: -s 42 grows the same tree every time, on the same size of window.

The Pop-Tart cat from 2011, rendered in coloured blocks and flying through space, with a counter at the bottom telling you how long you’ve spent watching it. That number is the program’s only form of judgement, and it’s enough.

Terminal window
nyancat

Install: brew install nyancat · sudo apt install nyancat · sudo dnf install nyancat.

Catch: it’s built from background colours, so it needs a terminal with 256 colours and a reasonably square font to look like a cat. The counter, sadly, works everywhere.

Prints your system’s details next to your distro’s logo in ASCII art. You will have seen it in every screenshot posted to r/unixporn, where it’s how people show off a setup, and the reason a lot of those screenshots look the same.

Terminal window
fastfetch
Terminal window
.hddddddddddddddddddddddh. ninja@dojo
:dddddddddddddddddddddddddd: ----------
/dddddddddddddddddddddddddddd/ OS: Alpine Linux v3.24 i686
+dddddddddddddddddddddddddddddd+ Kernel: Linux 6.18.58-0-virt
`sdddddddddddddddddddddddddddddddds` Uptime: 45 seconds
`ydddddddddddd++hdddddddddddddddddddy` Packages: 172 (apk)
.hddddddddddd+` `+ddddh:-sdddddddddddh. Shell: bash 5.3.9
hdddddddddd+` `+y: .sddddddddddh Display (Virtual-1): 800x600
ddddddddh+` `//` `.` -sddddddddd Terminal: xterm-256color
ddddddh+` `/hddh/` `:s- -sddddddd CPU: Pentium III (Katmai) @ 1.00 GHz
ddddh+` `/+/dddddh/` `+s- -sddddd GPU: QEMU Virtual Video Controller
ddd+` `/o` :dddddddh/` `oy- .yddd Memory: 19.00 MiB / 92.33 MiB (21%)
hdddyo+ohddyosdddddddddho+oydddy++ohdddh Swap: Disabled
.hddddddddddddddddddddddddddddddddddddh. Disk (/): 226.69 MiB / 256.00 GiB (0%) - 9p
`yddddddddddddddddddddddddddddddddddy` Locale: C.UTF-8
`sdddddddddddddddddddddddddddddddds`
+dddddddddddddddddddddddddddddd+
/dddddddddddddddddddddddddddd/
:dddddddddddddddddddddddddd:
.hddddddddddddddddddddddh.

In the playground, it reveals what’s actually running your Try it buttons: a Pentium III at 1 GHz with 92 MiB of RAM, which v86 emulates in your browser. The disk is the size of your patience; the files download as the guest asks for them.

Install: brew install fastfetch · sudo dnf install fastfetch · sudo apt install fastfetch on Debian 13. Ubuntu 24.04 doesn’t have it, so take the .deb from its GitHub releases.

Catch: it replaced neofetch, which did the same job until its author archived it in 2024. Ubuntu 24.04 still has neofetch, and it still works. It’s just not getting any newer.

A nonsense activity generator: it prints convincing output from jobs that aren’t running. A kernel compile, a Docker build, Terraform, a cryptominer, a memory dump, a botnet. Nothing is compiled, downloaded or mined. It just looks that way from across the room.

Terminal window
genact -m kernel_compile

Without -m it cycles through all 21 modules at random, and genact -l lists them. -s speeds it up, and --exit-after-time 10min stops it on its own, for meetings with a known length.

Install: brew install genact. Elsewhere, there are binaries on its GitHub releases page, or cargo install genact, which is the only genuinely busy thing you’ll do with it.

Catch: anyone who has actually compiled a kernel will notice it finishing in suspiciously good time on a Pentium III.

The fun of these is mostly in the combinations. A few that work, all ready to try:

Terminal window
cowsay -f dragon "$(git log -1 --format=%s)"
________________________________________
/ Read API_KEY from the environment, not \
\ from a sticky note /
----------------------------------------
\ / \ //\
\ |\___/| / \// \\
/0 0 \__ / // | \ \
/ / \/_/ // | \ \
@_^_@'/ \/_ // | \ \
//_^_/ \/_ // | \ \
( //) | \/// | \ \
( / /) _|_ / ) // | \ _\
( // /) '/,_ _ _/ ( ; -. | _ _\.-~ .-~~~^-.
(( / / )) ,-{ _ `-.|.-~-. .~ `.
(( // / )) '/\ / ~-. _ .-~ .-~^-. \
(( /// )) `. { } / \ \
(( / )) .----~-.\ \-' .~ \ `. \^-.
///.----..> \ _ -~ `. ^-` ^-_
///-._ _ _ _ _ _ _}^ - - - - ~ ~-- ,.-~
/.-~

The last commit message, read out by a dragon. That one is the playground’s demo project. Yours will say “wip”.

Terminal window
fortune -s | cowsay -f "$(cowsay -l | tail -n +2 | tr ' ' '\n' | shuf -n 1)"

A random cow every time: cowsay -l lists them, tail drops the header line, tr puts one name on each line and shuf picks one. On a Mac, shuf is gshuf from Homebrew’s coreutils.

Terminal window
echo "Deploying on a Friday" | boxes -d stone | cowsay -n
___________________________
/ +-----------------------+ \
| | Deploying on a Friday | |
\ +-----------------------+ /
---------------------------
\ ^__^
\ (oo)\_______
(__)\ )\/\
||----w |
|| ||

A box inside a speech bubble. -n stops cowsay re-wrapping the box into a mess.

Terminal window
jq -r '.users[] | select(.active) | .name' ~/demo/data.json | xargs -n1 figlet -f small

A banner for each active user in a JSON file, which is the jq guide put to its least responsible use. xargs -n1 runs figlet once per name rather than once for all of them.

Terminal window
tldr sl | cowsay -n | lolcat

Documentation, delivered by a rainbow cow. It’s the same information, and noticeably harder to ignore.

The traditional place for all this is your shell’s startup file, so every new terminal opens with a cow. That’s fine, as long as it only runs when a person is watching:

Terminal window
# ~/.bashrc or ~/.zshrc
if [[ $- == *i* ]] && command -v fortune >/dev/null && command -v cowsay >/dev/null; then
fortune -s | cowsay
fi

The $- test is the important part. When you run a command on a server over SSH, bash reads ~/.bashrc even though nobody’s at the keyboard, so a cow printed there ends up in the output of scp and rsync, which were expecting their own protocol and get a farmyard. rsync’s error message, “protocol version mismatch – is your shell clean?”, is it asking very politely whether you’ve done this. Most distros’ default .bashrc already returns early for non-interactive shells; put the cow below that line, or keep the test.

  • tty-clock — a big digital clock in the middle of the screen; q quits
  • More cows — cowsay -l again; the stegosaurus and the elephant in the snake are the best of them
  • rev and factor — not jokes at all, but a lot of people meet them for the first time in lists like this: rev reverses each line, and factor 2026 finds the prime factors

Every command above, honourable mentions included, is installed in the Linux playground, apart from toilet.

Everything above needs a package manager. These need only curl, nc or ssh, which a Mac and nearly every Linux box already have, and somebody else’s server. That last part is the catch: they’re run by volunteers, for nothing, and any of them could be gone by the time you read this. They have no Try it buttons either, because the playground can’t reach the internet.

Terminal window
nc towel.blinkenlights.nl 23

A New Hope, re-enacted in text characters and streamed to your terminal, one frame at a time, until Ctrl+C. Over IPv4 it’s in black and white; its own introduction points out that the IPv6 version has extra scenes and colour. telnet towel.blinkenlights.nl does the same, if you have telnet. macOS stopped shipping it some years ago.

Terminal window
curl 'wttr.in/London?0'
Terminal window
Weather report: London
\ / Clear
.-. +11(9) °C
― ( ) ― ↗ 14 km/h
`-’ 10 km
/ \ 0.0 mm

?0 is the current conditions only. Leave the place out and wttr.in guesses it from your IP address; leave the ?0 off and you get three days of forecast in a table 125 columns wide, so make the window bigger first. curl wttr.in/Moon draws the moon in its current phase, and curl wttr.in/:help lists the rest. The quotes stop zsh treating the ? as a wildcard.

Terminal window
curl parrot.live

The party parrot, in colour, dancing until you press Ctrl+C. ascii.live does the same for other animations, and there are a lot of them: curl ascii.live/list names the lot.

Terminal window
curl qrenco.de/terminal.ninja

Whatever follows the slash, as a QR code drawn in block characters. Point your phone at the screen and it scans, which makes it a quick way to get a URL from a terminal onto a phone, and the only thing in this section with a use.

Terminal window
curl cheat.sh/tar

Possibly the second thing with a use: the common invocations of a command, with comments, like tldr without installing tldr.

Terminal window
curl https://icanhazdadjoke.com
You can't trust a ladder. It will always let you down

One joke, in plain text, different every time. They are all of this standard.

Terminal window
ssh sshtron.zachlatta.com

Light cycles, multiplayer, in the terminal. Turn before you hit anything. You only score when other people are playing, so it works best with a colleague, and better still with one who should be doing something else.

say reads text aloud, which is more useful than it sounds on the end of a long build (make; say done) and less useful than it sounds in an open-plan office. say -v '?' lists the voices: Cellos sings it, Whisper whispers it and Zarvox is a robot.

Terminal window
say -v Cellos "The build has finished"

banner did figlet’s job first, for printers with continuous paper, which is why it prints down the page rather than across. It comes with macOS and the BSDs.

Terminal window
banner -w 32 hi
# #
######################
######################
#
##
# ##
#############
###########
# #
############# ###
############# ###

And if Python is installed, python3 -c 'import this' prints the Zen of Python, while python3 -c 'import antigravity' opens the xkcd strip it’s a joke about in your browser.

Had your fun? The modern CLI starter pack is the same idea, pipes and small tools, applied to things you’ll do every day. And if lolcat came out looking like stairs rather than a rainbow, the truecolor guide is where to find out which part of your setup is lying about TERM.