fortune (Unix)
   HOME

TheInfoList



OR:

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. Pseudorandom number generators are often used in computer programming, as tradi ...
message from a database of quotations. Early versions of the program appeared in
Version 7 Unix Version 7 Unix, also called Seventh Edition 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 commerc ...
in 1979. The most common version on modern systems is the
BSD The Berkeley Software Distribution (BSD), also known as Berkeley Unix or BSD Unix, is a discontinued Unix operating system developed and distributed by the Computer Systems Research Group (CSRG) at the University of California, Berkeley, beginni ...
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 Software Distribution (BS ...
. 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 made from flour, sugar, vanilla, and sesame seed oil with a piece of paper inside, a "fortune", an aphorism, or a vague prophecy. The message inside may also include a Chinese language, Chines ...
s (hence the name), quotations from famous people, jokes, or poetry. fortune is predominantly found on
Unix-like A Unix-like (sometimes referred to as UN*X, *nix 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 Uni ...
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 modes.


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, information, and automation. Computer science spans Theoretical computer science, theoretical disciplines (such as algorithms, theory of computation, and information theory) to Applied science, ...
and
computer programming Computer programming or coding is the composition of sequences of instructions, called computer program, programs, that computers can follow to perform tasks. It involves designing and implementing algorithms, step-by-step specifications of proc ...
. Other favoured sources include quotations from
science fiction Science fiction (often shortened to sci-fi or abbreviated SF) is a genre of speculative fiction that deals with imaginative and futuristic concepts. These concepts may include information technology and robotics, biological manipulations, space ...
(''
Star Trek ''Star Trek'' is an American science fiction media franchise created by Gene Roddenberry, which began with the Star Trek: The Original Series, series of the same name and became a worldwide Popular culture, pop-culture Cultural influence of ...
'', ''
The Cyberiad ''The Cyberiad'' (), sometimes subtitled ''Fables for the Cybernetic Age'', is a series of humorous science fiction short story, short stories by Polish writer Stanisław Lem published during 1964–1979. The first collected set of stories was or ...
'', ''
Doctor Who ''Doctor Who'' is a British science fiction television series broadcast by the BBC since 1963. The series, created by Sydney Newman, C. E. Webber and Donald Wilson (writer and producer), Donald Wilson, depicts the adventures of an extraterre ...
'', ''
The Hitchhiker's Guide to the Galaxy ''The Hitchhiker's Guide to the Galaxy'' is a Science fiction comedy, comedy science fiction franchise created by Douglas Adams. Originally a The Hitchhiker's Guide to the Galaxy (radio series), radio sitcom broadcast over two series on BBC ...
'', 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 one of "The 100 Greatest Masterpieces of American Literature" by the ...
and
Dave Barry David McAlister Barry (born July 3, 1947) is an American author and columnist who wrote a nationally Print syndication, syndicated humor column for the ''Miami Herald'' from 1983 to 2005. He has written numerous books of humor and parody, as we ...
. 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. 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 1889 – 30 April 1945) was an Austrian-born German politician who was the dictator of Nazi Germany from 1933 until Death of Adolf Hitler, his suicide in 1945. Adolf Hitler's rise to power, He rose to power as the lea ...
being contained in some of the files. The exact fortunes vary between each type of Unix, however there seems to be a strong overlap between the
FreeBSD FreeBSD is a free-software Unix-like operating system descended from the Berkeley Software Distribution (BSD). The first version was released in 1993 developed from 386BSD, one of the first fully functional and free Unix clones on affordable ...
and
OpenBSD OpenBSD is a security-focused operating system, security-focused, free software, Unix-like operating system based on the Berkeley Software Distribution (BSD). Theo de Raadt created OpenBSD in 1995 by fork (software development), forking NetBSD ...
fortune files. The Plan 9 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), 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. 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 1983 in RFC 865 by Jon Postel. As indicated there, the QOTD concept predated the specification, when QOTD was used by mainframe sysadmins to broadcast a dai ...


References


External links

* *
A PHP version of the fortune program

The manual page for the original Unix fortune(6) command

Maintenance version of fortune-mod's source code
- on
GitHub GitHub () is a Proprietary software, proprietary developer platform that allows developers to create, store, manage, and share their code. It uses Git to provide distributed version control and GitHub itself provides access control, bug trackin ...
with new releases ** – source code for fortune-mod program
A wiki containing all of the original non offensive fortunes

A modern, color-terminal oriented fortune database

A fortune-mod add on for math-related fortunes

A portable and full implementation in Python
distributed with all th
classical
an
historical cookie files
{{Plan 9 commands 1979 software Unix software Novelty software Free and open-source Android software Plan 9 commands