用 fortune 在终端随机打印一句格言
每次运行 fortune 都输出随机的格言、笑话或谚语。
运行 fortune 会随机打印一句名言;加 -s 只输出短句。
01命令
命令
$ fortune -s02作用说明
fortune 会从多个文本库中随机取出一条,因此常见于 shell 启动文件和 MOTD。短句模式 -s 可避免大段文字,-o 则改用成人语录库。配合 cowsay 就是经典欢迎语。
03风险
!注意: 部分语录库内容不适合共享日志;-o 专门选择成人语录库。
04撤销
✓无需撤销——该命令不会改变持久状态。
05来源
- Homebrew formula: fortune依据: Installs the fortune command with a bundled collection of quote databases.
- fortune(6) — Debian manpage依据: Documents the fortune command, its databases and the -s short mode.
最后验证: 2026-09-20 · 分类: 开发者