We ❤️ Open Source
A community education resource
The completely useless fortune command on Linux
How to generate random jokes, pick categories, and add humor to server logins.
Random terminal jokes might seem pointless, but what if they could actually make logging into servers more enjoyable? In this video from Learn Linux TV, you’ll learn how the fortune command turns mundane logins into moments of mild amusement.
Jay walks through the completely useless but surprisingly fun fortune command, which displays random jokes (called “fortunes”) in your terminal. After installing the fortune-mod package, you can run fortune to get a random joke, use -s for short fortunes or -l for longer ones, and even select specific categories like literature, science, or Star Trek (though available categories vary by distribution).
The tutorial demonstrates combining fortune with other commands for added entertainment. Piping fortune into cowsay makes a cow deliver your jokes, while adding the -f tux flag to cowsay replaces the cow with a penguin. Wrapping the entire command in watch refreshes the joke every two seconds for continuous amusement.
Jay shares his practical use case: Displaying a “joke of the day” in the message of the day file that appears when logging into Linux servers. While the fortune command offers zero productivity benefits, it proves that not every Linux tool needs to be serious to have value.
Key takeaways
- Fortune categories differ by distro – Debian and Fedora include different
fortunedatabases, so categories like Star Trek or science may only work on certain distributions. - Combine fortune with cowsay for maximum fun – Piping
fortune | cowsay -f tuxdelivers jokes via a penguin, turning pointless commands into genuinely entertaining output. - Actually useful in MOTD files – The
fortunecommand makes a legitimate addition to message of the day systems, giving you something to smile about when logging into servers.
The fortune command proves that Linux has a sense of humor. Jay’s tutorial shows that even the most pointless commands can find legitimate use cases if you’re creative enough.
More from Learn Linux TV
- youtube.com/learnlinuxtv
- Linux tips | Linux how-to’s | Linux installation guides
- Stop feeling guilty about Linux distro hopping
- Getting started with COSMIC desktop tiling
- 10 tips to learn Linux easier and faster
The opinions expressed on this website are those of each author, not of the author's employer or All Things Open/We Love Open Source.