Get a Random fortune cookie using the Unix fortune command
I have been using linux for more than 3 years, but I still come across some old/legacy applications that I have never even heard of. This time I came to know about the legendary fortune command. All it does is throw some random fortune (quotation) from a huge database on your screen. Before coming to any conclusion about the software, try it out first
.
Installation
It is available in the form of fortune-mod package. Install it
[shredder12]$ sudo aptitude install fortune-mod #ubuntu or debian
[root]# yum install fortune-mod #fedora or RedHat based systems
Its not all about random message fetching. This database of messages is divided into various categories which are further sub-divided into offensive and non-offensive ones and you can tell the fortune command to run in favour of either of them. Say you want to fetch the epigrams from the category linux.
[shredder12]$ fortune linux
I've seen people with new children before, they go from ultra happy to
looking like something out of a zombie film in about a week.
-- Alan Cox about Linus after his 2nd daughter
You can even mention multiple categories
[shredder12]$ fortune linux science
They can each be preceded with the probability you want a fortune to be picked from them. Say:
[shredder12]$ fortune 90% linux 10% science
Although, 10% for science was not required, as the rest of the probability (100 - sum of all mentioned) is applied to the rest. You can find the list of categories or files searched in /usr/share/games/fortunes.
For fetching only from offensive databases use the -o option.
[shredder12]$ fortune -o
You can even do pattern searching, using -m. Say you want to read all the fortunes under linux category containing the word 'sex'
.
[shredder12]$ fortune linux -m sex
(/usr/share/games/fortunes/linux)
%
Software is like sex; it's better when it's free.
-- Linus Torvalds
%
You can find more about fortune in its man page. Have fun.
1 Comment
Post new comment