fortune — print a random inspiring quote or developer joke
SYNOPSIS
fortune [-q | -j]
DESCRIPTION
Prints a random quote (from dummyjson.com) or a programming joke (from JokeAPI, safe mode) — picked at random unless an option says which. Both are free public APIs queried directly from your browser; if they are unreachable, a built-in fortune is shown instead.
OPTIONS
-q, --quote an inspiring quote -j, --joke a developer joke
HOW IT WORKS
With no option, a coin flip picks between a quote and a joke. Quotes come from the dummyjson.com public quotes API; programming jokes from JokeAPI with its safe mode on, so no offensive content is returned. The request has a short timeout: offline or rate-limited, fortune falls back to a small built-in collection.
USE CASES
- a quick smile or some inspiration between two commands;
- a random line for a presentation, a commit message or a status update;
- chain it: fortune | say reads it aloud, fortune | asciiart -s small prints it big.
NOTES
The name comes from the classic Unix fortune program, which printed a random epigram at login.
EXAMPLES
fortune fortune -j quote -q