cowsay is a program that generates ASCII art pictures of a cow with a message.[2] It can also generate pictures using pre-made images of other animals, such as Tux the Penguin, the Linux mascot. It is written in Perl. There is also a related program called cowthink, with cows with thought bubbles rather than speech bubbles. .cow files for cowsay exist which are able to produce different variants of cows, with different kinds of eyes, and so forth.[3] 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.[4]
Example
The Unix command fortune can also be piped into the cowsay command:
[user@hostname ~]$ fortune|cowsay
________________________________________/ You have Egyptian flu: you're going to \\ be a mummy. / ---------------------------------------- \ ^__^ \ (oo)\_______ (__)\ )\/\ ||----w | || ||
Using the parameter -f followed by tux, one can replace the cow with other beings, such as Tux, the Linux mascot:
[user@hostname ~]$ fortune|cowsay-ftux
_________________________________________/ You are only young once, but you can \\ stay immature indefinitely. / ----------------------------------------- \ \ .--. |o_o | |:_/ | // \ \ (| | ) /'\_ _/`\ \___)=(___/
Using the parameter -l shows all available cow files:
Disables word wrap, allowing the cow to speak FIGlet or to display other embedded ASCII art. Width in columns becomes that of the longest line, ignoring any value of -W.
-W
Specifies width of the speech balloon in columns, i.e. characters in a monospace font. Default value is 40.
-b
“Borg mode”, uses == in place of oo for the cow′s eyes.
-d
“Dead”, uses XX, plus a descending U to represent an extruded tongue, also used on Linux kernel oops.
-g
“Greedy”, uses $$.
-p
“Paranoid”, uses @@.
-s
“Stoned”, uses ** to represent bloodshot eyes, plus a descending U to represent an extruded tongue.
Manually specifies the cow′s tongue shape, e.g. cowsay -T \(\) for a pair of parentheses.[5]
-f cowfile
Specifies a .cow file from which to load alternative ASCII art. Accepts both absolute file-paths and those relative to the environment variableCOWPATH.
-l
Lists the names of available cow-files in the COWPATH directory instead of displaying a quote.
^ abCharacters other than printable in C0 controls and basic Latin (U+0021–U+007E) will not display properly as these parameters accept only the first two bytes of input value. Using a pre-defined cow-face will over-ride any value of -e and -T.
Sandra Henry-Stocker (Dec 15, 2020). "Creating your own cowsay messenger". Unix as a Second Language; Network World. networkworld.com. Retrieved 21 September 2023.
c't Spaß mit Technik (2018): Einfache Computerprojekte zum Selbermachen. p. 120. c't-Redaktion; Heise Medien GmbH & Co. KG. ISBN9783957882073. Retrieved 21 September 2023.