fortune is a simple program that displays a pseudorandom message from a database of quotations that first appeared in Version 7 Unix. The most common version on modern systems is the BSD
fortune, originally written by Ken Arnold. Distributions of fortune are usually bundled with a collection of themed files, containing sayings like those found on fortune cookies (hence the name), quotations from famous people, jokes, or poetry.
cowsay is a program which generates ASCII pictures of a cow with a message. It can also generate pictures using pre-made images of other animals, such as Tux the Penguin, the Linux mascot. Tony Monroe is credited as the original author. Since it is written in Perl, it is adaptable to other systems such as Microsoft Windows. .cow files for cowsay exist which are able to produce different variants of “cows”, with different kinds of “eyes”, and so forth. It is sometimes used on IRC, desktop screenshots, and in software documentation. It is more or less a joke within hacker culture, but has been around long enough that its use is rather widespread. In 2007 it was highlighted as a Debian package of the day.
Fortune and Cowsay – random quotes and animals
Normally all the guides using
cowsay uses the default creatures (a.k.a
Cow!) to show different quotes. There’s plenty of guides on that. However, I wanted to show a random creature saying different fortune quotes on my terminal.I could find random figment of instructions in different forums and decided to write a small guide on how to do it properly. Few lines of codes, and my Linux terminal becomes more alive!
If you’re not familiar with
cowsay then keep reading for details otherwise you can just jump into the code section.
You can install
fortune in Debian, Ubuntu or Kali Linux or any aptitude/apt-get based distro using the following command:
apt-get install fortune (or) sudo apt-get install fortune
fortune is available in all the basic standard repositories, otherwise just add them for your respective Linux version.
You can install
fortune in Redhat, CentOS, Fedora of any yum based Linux distros using the following command:
yum install fortune (or) sudo yum install fortune
If you have a different distro, the command is pretty much the same.
Once installed you can just type in
fortune in your terminal and you get a random quote or joke.
List and location of fortune files
Fortune quotes and files are located here:
ls -l /usr/share/games/fortunes/