fortune
is a program that displays a
pseudorandom
A pseudorandom sequence of numbers is one that appears to be statistically random, despite having been produced by a completely deterministic and repeatable process.
Background
The generation of random numbers has many uses, such as for random ...
message from a database of quotations that first appeared in
Version 7 Unix
Seventh Edition Unix, also called Version 7 Unix, Version 7 or just V7, was an important early release of the Unix operating system. V7, released in 1979, was the last Bell Laboratories release to see widespread distribution before the commercia ...
. The most common version on modern systems is the
BSD
The Berkeley Software Distribution or Berkeley Standard Distribution (BSD) is a discontinued operating system based on Research Unix, developed and distributed by the Computer Systems Research Group (CSRG) at the University of California, Be ...
fortune
, originally written by
Ken Arnold
Kenneth Cutts Richard Cabot Arnold (born 1958) is an American computer programmer well known as one of the developers of the 1980s dungeon-crawling video game ''Rogue'', for his contributions to the original Berkeley (BSD) distribution of Unix ...
. Distributions of fortune are usually bundled with a collection of themed files, containing sayings like those found on
fortune cookie
A fortune cookie is a crisp and sugary cookie wafer usually made from flour, sugar, vanilla, and sesame seed oil with a piece of paper inside, a "fortune", usually an aphorism, or a vague prophecy. The message inside may also include a Chines ...
s (hence the name), quotations from famous people, jokes, or poetry. As of November 2017, the quotations (with the exception of tips relevant to system operation) have been removed from FreeBSD entirely after user complaints regarding quotations from
Adolf Hitler
Adolf Hitler (; 20 April 188930 April 1945) was an Austrian-born German politician who was dictator of Nazi Germany, Germany from 1933 until Death of Adolf Hitler, his death in 1945. Adolf Hitler's rise to power, He rose to power as the le ...
being contained in some of the files.
fortune
is predominantly found on
Unix-like
A Unix-like (sometimes referred to as UN*X or *nix) operating system is one that behaves in a manner similar to a Unix system, although not necessarily conforming to or being certified to any version of the Single UNIX Specification. A Unix-li ...
systems, but clients for other platforms also exist. Often, users on text-mode Unix terminals will place this command into either their
.profile
or
.logout
files to display them at logon and logout, respectively. It is also used to generate text input for certain
XScreenSaver
XScreenSaver is a free and open-source collection of 240+
screensavers for Unix, macOS, iOS and Android operating systems. It was created by Jamie Zawinski in 1992 and is still maintained by him, with new releases coming out several times a ...
modes. It is possible to pipe fortune into the
cowsay
cowsay is a program that generates ASCII art pictures of a cow with a message. It can also generate pictures using pre-made images of other animals, such as Tux the Penguin, the Linux mascot. It is written in Perl. There is also a related progr ...
command, to add more humor to the dialog.
Content
Most Unix systems use fortunes which are slanted heavily toward the user base of Unix, and thus contain many obscure jokes about
computer science
Computer science is the study of computation, automation, and information. Computer science spans theoretical disciplines (such as algorithms, theory of computation, information theory, and automation) to practical disciplines (includin ...
and
computer programming
Computer programming is the process of performing a particular computation (or more generally, accomplishing a specific computing result), usually by designing and building an executable computer program. Programming involves tasks such as anal ...
. Other favoured sources include quotations from
science fiction
Science fiction (sometimes shortened to Sci-Fi or SF) is a genre of speculative fiction which typically deals with imagination, imaginative and futuristic concepts such as advanced science and technology, space exploration, time travel, Paral ...
(''
Star Trek
''Star Trek'' is an American science fiction media franchise created by Gene Roddenberry, which began with the eponymous 1960s television series and quickly became a worldwide pop-culture phenomenon. The franchise has expanded into vario ...
'', ''
The Cyberiad
''The Cyberiad'' ( pl, Cyberiada) is a series of humorous science fiction short stories by Polish writer Stanisław Lem, originally published in 1965, with an English translation appearing in 1974. The main protagonists of the series are Trurl a ...
'', ''
Doctor Who'', ''
The Hitchhiker's Guide to the Galaxy
''The Hitchhiker's Guide to the Galaxy'' (sometimes referred to as ''HG2G'', ''HHGTTG'', ''H2G2'', or ''tHGttG'') is a comedy science fiction franchise created by Douglas Adams. Originally a 1978 radio comedy broadcast on BBC Radio 4, it ...
'', etc.),
Zippy the Pinhead
Zippy the Pinhead is a fictional character who is the protagonist of ''Zippy'', an American comic strip created by Bill Griffith. Zippy's most famous quotation, "Are we having fun yet?", appears in ''Bartlett's Familiar Quotations'' and became a ...
, and the writings of
Ambrose Bierce
Ambrose Gwinnett Bierce (June 24, 1842 – ) was an American short story writer, journalist, poet, and American Civil War veteran. His book '' The Devil's Dictionary'' was named as one of "The 100 Greatest Masterpieces of American Literature" by ...
and
Dave Barry
David McAlister Barry (born July 3, 1947) is an American author and columnist who wrote a nationally syndicated humor column for the '' Miami Herald'' from 1983 to 2005. He has also written numerous books of humor and parody, as well as comi ...
. Most fortune collections also include a wide variety of more conventionally sourced quotations, jokes, and other short passages. A few distributions include "offensive" dicta, which require the
-a
or
-o
options to be passed for viewing. These fortunes often include rude humor and profanity, personal attacks, and controversial comments about religion. Sometimes they are provided by another package, however as of FreeBSD 10.0 the offensive dicta have been removed completely.
The exact fortunes vary between each type of Unix, however there seems to be a strong overlap between the
FreeBSD
FreeBSD is a free and open-source Unix-like operating system descended from the Berkeley Software Distribution (BSD), which was based on Research Unix. The first version of FreeBSD was released in 1993. In 2005, FreeBSD was the most popular ...
and
OpenBSD
OpenBSD is a security-focused operating system, security-focused, free and open-source, Unix-like operating system based on the Berkeley Software Distribution (BSD). Theo de Raadt created OpenBSD in 1995 by fork (software development), forking N ...
fortune files. The
Plan 9 Plan 9 or Plan Nine may refer to:
Music
* Plan 9 (band), a psychedelic rock band from Rhode Island
* ''Plan 9'', an album by Big Guitars From Memphis with Rick Lindy
* "Plan 9", a song on the 1993 album ''Gorgeous'' by electronica band 808 Stat ...
fortune files seem to be much shorter, with many just on 1 line, and the 'offensive' dicta is much stronger. Most Linux distributions, such as Debian (and its
derivatives
The derivative of a function is the rate of change of the function's output relative to its input value.
Derivative may also refer to:
In mathematics and economics
*Brzozowski derivative in the theory of formal languages
*Formal derivative, an ...
), choose the FreeBSD fortunes to put in their fortune packages, that can be installed through the package manager.
Purpose
One of the included fortunes, from the "goedel" collection of fortunes about
fortune
itself, sums up the purpose of the program:
The original
fortune
program could be used for the more general task of picking up a random line from a plain-text file. The example of such use is given in th
rc documentation However, in most modern Unix systems
fortune
cannot be used this way, since they use an ad hoc file format for fortune files to allow multiline aphorisms.
Fortune files
Conventional versions of
fortune
use two files for each quotation list: a text file with quotations, each separated by the character "%" on its own line, and a random-access data file generated by the
strfile
(1) program. Alternative implementations, including those made for display on Web pages, typically use only the text file.
Common options
Several common options exist that change the way command-line versions of fortune behave:
See also
*
QOTD
The Quote of the Day (QOTD) service is a member of the Internet protocol suite, defined in RFC 865. As indicated there, the QOTD concept predated the specification, when QOTD was used by mainframe sysadmins to broadcast a daily quote on request by ...
References
External links
*
*
A PHP version of the fortune programThe manual page for the original Unix fortune(6) command
Maintenance version of fortune-mod's source code- on
GitHub
GitHub, Inc. () is an Internet hosting service for software development and version control using Git. It provides the distributed version control of Git plus access control, bug tracking, software feature requests, task management, co ...
with new releases
** ftp://ftp.ibiblio.org/pub/linux/games/amusements/fortune/ – source code for fortune-mod program
A wiki containing all of the original non offensive fortunesA modern, color-terminal oriented fortune databaseA fortune-mod add on for math-related fortunesA portable and full implementation in Python distributed with all th
classicalan
historical cookie files
{{Plan 9 commands
1979 software
Unix software
Novelty software
Free and open-source Android software
Plan 9 commands