LLMpediaThe first transparent, open encyclopedia generated by LLMs

Fortune (software)

Generated by GPT-5-mini
Note: This article was automatically generated by a large language model (LLM) from purely parametric knowledge (no retrieval). It may contain inaccuracies or hallucinations. This encyclopedia is part of a research project currently under review.
Article Genealogy
Parent: USENET Hop 4
Expansion Funnel Raw 117 → Dedup 0 → NER 0 → Enqueued 0
1. Extracted117
2. After dedup0 (None)
3. After NER0 ()
4. Enqueued0 ()
Fortune (software)
NameFortune
TitleFortune
DeveloperBSD community
Released1983
Latest release versionvar.
Operating systemUnix-like
GenreCommand-line utility
LicenseBSD, permissive

Fortune (software) is a computer program that displays quotations, aphorisms, and witticisms at random, originally created for Unix systems. It has been distributed across many Berkeley Software Distribution derivatives and included in packages for Linux, Plan 9, and other Unix-like environments. The program is notable for its integration with text filters such as cowsay and for its cultural role within open-source and hacker culture communities.

Overview

Fortune is a simple, text-based utility that reads from a database of sayings (commonly called "fortune files") and prints a randomly selected entry to standard output. It is frequently used in login scripts, shell prompts, and mail filters on systems derived from BSD and ports to distributions like Debian, Red Hat Enterprise Linux, and Arch Linux. The program works in concert with utilities such as cron, rootkit, and display programs including xterm and rxvt in graphical sessions. Historically, Fortune files have been curated collections referencing works by authors and organizations such as Mark Twain, Douglas Adams, Monty Python, Stanislaw Lem, Isaac Asimov, Kurt Vonnegut, Samuel Beckett, George Orwell, Robert Heinlein, J.R.R. Tolkien, H.P. Lovecraft, Arthur C. Clarke, Terry Pratchett, William Shakespeare, Noam Chomsky, Alan Turing, Grace Hopper, Ken Thompson and Dennis Ritchie.

History and Development

Fortune was first written in the early 1980s at University of California, Berkeley as part of the BSD userland, drawing on the culture of the MIT AI Lab and the Stanford Artificial Intelligence Laboratory. Early maintainers and contributors came from communities around 4.3BSD, NetBSD, FreeBSD, and OpenBSD. Over time, editors curated files containing material from publications such as The New Yorker, Scientific American, Nature (journal), MAD (magazine), Punch (magazine), and collections including The Oxford Book of Humorous Prose and anthologies of science fiction writers. Licensing debates involved organizations like the Free Software Foundation and influenced packaging policies at vendors like Sun Microsystems and distributors including SCO and Caldera. Portable reimplementations and ports were made for systems including Microsoft Windows via Cygwin, and for Plan 9 from Bell Labs.

Features and Configuration

Fortune implements features for randomized selection, weighted selection, and database maintenance. It uses a flat-file database format with delimiters and includes helper tools for generating databases from plain text; maintainers often use Perl, Python (programming language), and awk scripts for preprocessing. Configuration commonly ties Fortune into shell environments such as Bash, Zsh, and Tcsh and graphical login managers like GDM and LightDM. Integrations include piping output into programs such as cowsay, ponysay, figlet, lolcat, and toilet for decorative rendering, or into mailx and sendmail for automated messages. Options include seeding the pseudo-random generator, selecting categories, and using the "-o" flag to choose offensive collections, a convention shaped by community guidelines and discussions on lists hosted by organizations such as GNU Project and archives on SourceForge and GitHub.

Implementation and Platforms

The original implementation is in C (programming language) and compiled with compilers such as gcc and clang. Distributions package variants for FreeBSD, NetBSD, OpenBSD, Debian GNU/Linux, Fedora Project, Gentoo Linux, and Slackware Linux. Ports exist for Android (operating system) terminals and for Microsoft Windows via compatibility layers like Cygwin and Windows Subsystem for Linux. Build systems used include GNU Autotools, CMake, and simple Makefile-based recipes in ports trees maintained by projects such as pkgsrc and Homebrew (package manager). The format of fortune files has been documented in manpages and in standards influenced by documentation efforts at The Open Group and the POSIX process model.

Reception and Use Cases

Fortune has been praised as a lightweight, whimsical tool within system administrator workflows, developer onboarding, and desktop customizations. It appears in cultural references and has been used in projects at institutions like MIT, Stanford University, Carnegie Mellon University, Harvard University, and Princeton University. System administrators incorporate it into welcome messages (via motd), SSH banners, and automated reports using Ansible, Puppet (software), and Chef (software). Academics and writers have cited fortune collections in works on computer culture and in oral histories related to figures such as Ken Thompson, Dennis Ritchie, and Brian Kernighan. Criticism has arisen around offensive content, prompting package maintainers at Debian and Ubuntu to separate "offensive" databases and to adopt policies echoing practices at organizations like Apache Software Foundation.

Alternatives and Derivatives

Several programs and services have been inspired by Fortune. Notable alternatives include cowsay companion scripts that generate their own quotes, web-based generators hosted on platforms like GitHub Pages and Heroku, and packaged replacements such as fortune-mod and custom clients for IRC bots and Slack (software). Derivatives include themed collections for Star Trek, Doctor Who, Dungeons & Dragons, and fandom communities tied to properties managed by Warner Bros., Disney, and BBC. Academic experiments have used fortune-style datasets in natural language processing research by teams at Google, Facebook, OpenAI, Stanford Natural Language Processing Group, and Carnegie Mellon University.

Category:Unix software