Print a Random Quote With fortune
Show a random aphorism, joke or proverb each time fortune runs.
Run fortune to print a random quotation; add -s to limit output to short entries.
01Command
Command
$ fortune -s02What it does
fortune reads one of several text databases and prints a random entry, which is why it often appears in shell startup files and MOTD banners. Short mode -s avoids wall-of-text results, and -o picks offensive-classic instead of the default database. Combine it with cowsay for the classic greeting.
03Risk
!Warning: Some databases contain quotes that may be unsuitable for shared logs; -o specifically selects the adult database.
04Undo
✓No undo needed — this command does not change persistent state.
05Sources
- Homebrew formula: fortuneEvidence: Installs the fortune command with a bundled collection of quote databases.
- fortune(6) — Debian manpageEvidence: Documents the fortune command, its databases and the -s short mode.
Last verified: 2026-09-20 · Category: Developer
06Related solutions
Change where screenshots are saved on Mac
Point macOS screen captures at any folder you choose instead of the desktop.
Download a file from a URL on Mac with curl
Grab any file from the web straight into the current folder — no browser needed.
Find files larger than 500 MB on Mac
List the biggest files in your home folder that are eating disk space.