FORTUNE(1)
π NAME π
fortune β print a random, hopefully interesting, adage. (Yep bestie, this is the fortune(1) page π)
β¨ SYNOPSIS β¨
fortune [-adefilosvw] [-n length] [-m pattern] [[N%] file/dir/all]
π DESCRIPTION π
When fortune is run with no arguments it prints out a random epigram. Epigrams are divided into several categories, where each category is subdivided into those which are potentially offensive and those which are not.
π OPTIONS π
Okay so hereβs the whole flag menu, no skips, no cap:
-aβ Choose from all lists of maxims, both offensive and not. (See the-ooption for more information on offensive fortunes.)-dβ Enable debug messages.-eβ Consider all fortune files to be of equal size (see the discussion below on multiple files).-fβ Print out the list of files which would be searched, but do not print a fortune.-lβ Long dictums only. See-non how βlongβ is defined in this sense.-mpattern β Print out all fortunes which match the regular expression pattern. Seeperlre(1)for a description of patterns.-nlength β Set the longest fortune length (in characters) considered to be βshortβ (the default is160). All fortunes longer than this are considered βlongβ. If you set the length too short and ask for short fortunes, or too long and ask for long ones, you will get an error.-oβ Choose only from potentially offensive aphorisms. Please, please, please request a potentially offensive fortune if and only if you believe, deep down in your heart, that you are willing to be offended. (And that if you are, youβll just quit using-orather than give us grief about it, okay?)
... let us keep in mind the basic governing philosophy of The Brotherhood, as handsomely summarized in these words: we believe in healthy, hearty laughter -- at the expense of the whole human race, if needs be. Needs be. --H. Allen Smith, "Rude Jokes"
-sβ Short apothegms only. See-non which fortunes are considered βshortβ.-iβ Ignore case for-mpatterns.-vβ Show version number and exit.-wβ Wait before termination for an amount of time calculated from the number of characters in the message. This is useful if it is executed as part of the logout procedure to guarantee that the message can be read before the screen is cleared.
The user may specify alternate sayings. You can specify a specific file, a directory which contains one or more files, or the special word all which says to use all the standard databases. Any of these may be preceded by a percentage, which is a number N between 0 and 100 inclusive, followed by a %. If it is, there will be a N percent probability that an adage will be picked from that file or directory. If the percentages do not sum to 100, and there are specifications without percentages, the remaining percent will apply to those files and/or directories, in which case the probability of selecting from one of them will be based on their relative sizes.
As an example, given two databases funny and not-funny, with funny twice as big, saying
fortune funny not-funny
will get you fortunes out of funny two-thirds of the time. The command
fortune 90% funny 10% not-funny
will pick out 90% of its fortunes from funny (the β10% not-funnyβ is unnecessary, since 10% is all thatβs left). The -e option says to consider all files equal; thus
fortune -e
is equivalent to
fortune 50% funny 50% not-funny
π FILES π
The manual literally lists these paths/files, bestie:
fortune readme ./fortunes ./fortunes/fortunes1 ./fortunes/fortunes2-o ./fortunes/fortunes2 ./fortunes/limerick ./fortunes/lwall ./fortunes/startrek ./fortunes/zippy
π BUGS π
Currently there is no installer and the fortunes listed above are not included. Because of this, fortune might not find any files unless you specify them on the command line. Fr fr, thatβs the whole bug note π
π¦ TO DO π¦
Bundle files and possibly make an installer.
π REVISION HISTORY π
- Revision
2.1β2006/01/16β mike ciul- Enabled a lot of options
- Fixed known bugs
- Added
-noption
- Revision
1.0.1β1999/06/07β andy murren- Small fixes and code clean up
FindBinnow helps locate the directory of fortunes- Will search multiple files for a match
- Dumped the
-goption I tried in the original
- Revision
1.0β1999/04/01β andy murren- Initial Revision
π«Ά AUTHOR π«Ά
This Perl implementation of fortune was written by Andy Murren, andy@murren.org.
π COPYRIGHT and LICENSE π
This program is covered by the GNU Public License (GPL). See <http://www.gnu.org/copyleft/gpl.html> for complete detail of the license.
Source/version vibe: perl v5.42.2, dated 2026-02-15, manual FORTUNE(1) β mwah π
π¦ where this page comes from
- alpine 3.24: perl-power-tools-doc 1.053-r1 Β· GPL-2.0-or-later AND Artistic-1.0-Perl AND Artistic-2.0 AND BSD-2-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms