Cowsay (or tuxsay) fortunes in terminal

Note: I often have links set to open in a new tab & try to indicate that using the mouse hover popup.

This is a quick guide on how to have Cowsay (or Tuxsay, etc.) with fortunes upon opening the terminal.

I have it set up using fortune's "wisdom" quotes. They're not difficult to create; install the "fortune-mod" package (along with "fortunes" and "cowsay"); use the strfile tool on a formatted text file like "strfile vocab-fortune vocab-fortune.dat" and put it in fortune's directory, e.g. /usr/share/fortune or /usr/share/games/fortunes/ on Debians.
I have a kjv & a vocabulary set available.

Add the following to your ~/.bashrc (".bashrc" is a hidden file in the Home or "~/" directory):

# BASH COWSAY WITH FORTUNE
alias cowsay='cowsay -f tux'
fortune -s wisdom | cowsay

The alias is for it to use tux and the "fortune -s wisdom" is where to set the fortune file to be used.
See man fortune and man cowsay for options.


Back to Top