cowsay: a configurable talking and thinking cow
October 28th, 2007 edited by Alexey BeshenovArticle submitted by Alexey Beshenov. We are running out of articles! Please help DPOTD and submit good articles about software you like!
Cowsay is a useless but very fun text filter written in Perl. If you send some text into cowsay, you get an ASCII cow saying your text. For example, cowsay Hello, World! prints
_______________ < Hello, World! > --------------- \ ^__^ \ (oo)\_______ (__)\ )\/\ ||----w | || ||
To get a thinking cow, run cowthink:
$ cowthink Hello, World! _______________ ( Hello, World! ) --------------- o ^__^ o (oo)\_______ (__)\ )\/\ ||----w | || ||
Program word-wraps long messages unless the -n switch is used. The -W specifies where the message should be wrapped (default is wrapping at or before the 40th column). Everything left over after command-line switches is treated as the cow’s message. Another way is to send text to cowsay’s standard input. Pipe boring or annoying things to speaking / thinking cow and have fun:
$ uptime | cowthink -d _____________________________________ ( 19:16:39 up 4 days, 22:50, 1 user, ) ( load average: 2.21, 1.74, 1.42 ) ------------------------------------- o ^__^ o (xx)\_______ (__)\ )\/\ U ||----w | || ||
-d is a switch for a dead cow. Other fun switches for cow are
- -b Borg mode
- -g greedy mode
- -p paranoia mode
- -s stoned mode
- -t tired mode
- -w wired mode
- -y youthful mode
The -e selects the appearance of the cow’s eyes (default is -e oo). The tongue is configurable through -T (default is no tongue).
You can also use other ASCII characters. Cowsay comes with a large set of “cowfiles” (actually, a pieces of Perl code) in /usr/share/cowsay/cows. Invoke cowsay with the -l switch to list them:
apt, beavis.zen, bong, bud-frogs, bunny, cheese, cower, daemon, default, dragon, dragon-and-cow, elephant, elephant-in-snake, eyes, flaming-sheep, ghostbusters, head-in, hellokitty, kiss, kitty, koala, kosh, luke-koala, mech-and-cow, meow, milk, moofasa, moose, mutilated, ren, satanic, sheep, skeleton, small, sodomized, sodomized-sheep, stegosaurus, stimpy, supermilker, surgery, telebears, three-eyes, turkey, turtle, tux, udder, vader, vader-koala, www.
The -f option specifies a particular cowfile (note that -bdgpstwy modes may not work with some characters as well as -T and -e switches):
$ cowsay -f moose Hi! _____ < Hi! > ----- \ \ \_\_ _/_/ \ \__/ (oo)\_______ (__)\ )\/\ ||----w | || ||
Cowsay is written by Tony Monroe. The current stable branch is 3.xx, but Cowsay 4 is also available for testing from the official webpage. Cowsay packages can be found in Debian from Oldstable to Unstable and Experimental, and in Ubuntu Dapper, Edgy, Feisty, Gutsy. Of course, the program depends on Perl.
October 28th, 2007 at 10:26 am
Jeje. Nice!
Now I know where the super cow from apt-get comes from =)
October 28th, 2007 at 5:03 pm
I know it’s great because my wife thinks it’s stupid.
November 6th, 2007 at 2:32 am
For ascii emails I use it to display the subject as the first line of every email. But could also display the local weather as a signature, etc.
Who said the plain text should not be funny?
November 25th, 2007 at 12:55 am
# for cow in `cowsay -l | grep -v ^Cow`; do cowsay -f “$cow” “$cow”; done
April 23rd, 2008 at 12:45 pm
Wordpress is messing up the quotes. That’s why your command didn’t
work here at first. Actually you don’t need any in this case:
for cow in cowsay -l | grep -v ^Cow; do cowsay -f $cow $cow; done
September 4th, 2008 at 6:43 pm
I love this applications :D
Good command to run is:
fortune | cowsay
Jam
April 13th, 2009 at 7:24 am
An amazing toy for the super-bored mind.
June 22nd, 2009 at 6:20 am
how to cow say color text?