Fortune (Unix)

Fortune (Unix)

fortune is a simple program that displays a random message from a database of quotations. Most distributions of fortune are bundled with a collection of themed files, containing sayings like those found on fortune cookies (hence the name), quotations from famous people, jokes, or poetry. fortune is predominantly found on Unix-like systems, but clients for other platforms exist as well. 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.

Most Unix systems use a roughly equivalent set of fortunes. The fortunes dispensed are slanted heavily toward the user base of Unix, and thus contain many obscure jokes about computer science and computer programming. Other favoured sources include quotations from science fiction ("Star Trek", "The Cyberiad", "Doctor Who", "The Hitchhiker's Guide to the Galaxy", etc.), and the writings of Ambrose Bierce and Dave Barry. Most fortune collections also include a wide variety of more conventionally-sourced quotations, jokes, and other short passages. A few distributions include so-called "offensive" dicta, which require the -a or -o options to be passed for viewing (see the section "Common options" below).

One of the included fortunes, from the "goedel" collection of fortunes about fortune itself, sums up the purpose of the program:

Has anyone realized that the purpose of the fortune cookie program is to defuse project tensions? When did you ever see a cheerful cookie, a non-cynical, or even an informative cookie? Perhaps inadvertently, we have a channel for our aggressions. This still begs the question of whether the cookie releases the pressure or only serves to blunt the warning signs. Long live the revolution! Have a nice day.

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(8) program. Alternative implementations, including those made for display on Web pages, typically use only the text file.

A fortune program first appeared in Version 7 Unix. The most common version on modern systems is the BSD fortune, originally written by Ken Arnold.

Common options

Several common options exist that change the way command-line versions of fortune behave:

External links

* [http://linux.die.net/man/6/fortune The manual page for the fortune program]
* [http://fortunecookies.in/ An online version based on the Unix fortune program]
* [http://aasted.org/quote/ A PHP framework for reading and displaying fortune files]


Wikimedia Foundation. 2010.

Игры ⚽ Нужен реферат?

Look at other dictionaries:

  • Fortune (Unix) — fortune программа для юникс совместимых операционных систем, выдающая некоторую цитату, афоризм или шутку, случайным образом взяв его/её из текстовых файлов, содержащих коллекции подобных фраз. Название происходит от китайских «печений счастья»… …   Википедия

  • fortune (Unix) — У этого термина существуют и другие значения, см. Fortune. fortune программа для юникс совместимых операционных систем, выдающая некоторую цитату, афоризм или шутку, случайным образом взяв его/её из текстовых файлов, содержащих коллекции подобных …   Википедия

  • Fortune — may refer to: * Luck, a chance happening, or that which happens beyond a person s controls * Fortune and Destiny (Gad (deity) and Meni), gods referred to in * Wealth, an abundance of items of economic value * Fortune (magazine), America s second… …   Wikipedia

  • Fortune — Fortune: Fortune   общепринятое сокращение (обозначение) имени ботаника, которое добавляется к научным (латинским) названиям некоторых таксонов ботанической (бинарной) номенклатуры и указывает на то, что автором этих наименований… …   Википедия

  • Fortune (Programme) — Pour les articles homonymes, voir Fortune. fortune est un programme simple qui affiche un message au hasard provenant d une base de données de citations. La plupart des distributions de fortune comprennent des fichiers de citations de… …   Wikipédia en Français

  • Fortune (programme) — Pour les articles homonymes, voir Fortune. fortune est un programme simple qui affiche un message au hasard provenant d une base de données de citations. La plupart des distributions de fortune comprennent des fichiers de citations de… …   Wikipédia en Français

  • UNIX version 7 — UNIX version 7, appelé en anglais Version 7 Unix, Version 7 ou simplement V7, fut une version importante des débuts du système d exploitation UNIX. La version 7, publiée en 1979, fut la dernière version d UNIX des laboratoires Bell à être… …   Wikipédia en Français

  • Fortune Cookie — Un fortune cookie (biscuit chinois au Québec) est une confiserie, servie dans les restaurants chinois aux États Unis et au Canada, dans laquelle est insérée un petit morceau de papier où l on peut lire une prédiction ou une maxime, souvent… …   Wikipédia en Français

  • Fortune (homonymie) — Fortune Cette page d’homonymie répertorie les différents sujets et articles partageant un même nom …   Wikipédia en Français

  • Fortuné — Fortune Cette page d’homonymie répertorie les différents sujets et articles partageant un même nom …   Wikipédia en Français

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”