Linux command
fortune 命令
趣味
复制后可按需替换文件名、目录或参数。
常用示例
Display random fortune
fortune
Show short fortunes
fortune -s
Show offensive fortunes
fortune -o
Use specific database
fortune [literature]
Show fortune source
fortune -c
说明
fortune displays a random quotation, joke, or saying from its database files. It's the classic Unix program for adding whimsy to terminals and login sessions. Multiple fortune databases cover categories like literature, riddles, definitions, and jokes. Custom database files can be created with the strfile utility. fortune is commonly added to shell startup files for daily motivation or amusement.
参数
- -s
- Short fortunes only (< 160 chars).
- -l
- Long fortunes only.
- -c
- Show the fortune file source.
- -o
- Include offensive fortunes.
- -a
- Include all fortune files.
- -f
- List available fortune files.
- -m _PATTERN_
- Match pattern in fortunes.
- --help
- Display help information.
FAQ
What is the fortune command used for?
fortune displays a random quotation, joke, or saying from its database files. It's the classic Unix program for adding whimsy to terminals and login sessions. Multiple fortune databases cover categories like literature, riddles, definitions, and jokes. Custom database files can be created with the strfile utility. fortune is commonly added to shell startup files for daily motivation or amusement.
How do I run a basic fortune example?
Run `fortune` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -s do in fortune?
Short fortunes only (< 160 chars).