{{Short description|Program that generates ASCII pictures of a cow with a message}} {{lowercase}} {{Infobox software | name = cowsay | logo = | screenshot = Cowsay Typical Output.png | screenshot size = 217px | caption = | collapsible = | author = Tony Monroe | developer = | released = 1999 | latest release version = {{wikidata|property|edit|reference|P348}} | latest release date = {{start date and age|{{wikidata|qualifier|P348|P577}}}} | latest preview version = | latest preview date = | programming language = Perl | operating system = Cross-platform | platform = | size = | language = English | status = | genre = | license = Artistic License / GNU General Public License | website = {{Official website}} }} {{Portal|Free and open-source software}} '''cowsay''' is a program that generates ASCII art pictures of a cow with a message.<ref>{{cite web |url=http://linuxgazette.net/issue67/orr.html |title=cowsay--ASCII Art for Your Screen |work=Linux Gazette |date=June 2001 |access-date=2012-04-24 |author=Orr, Mike |url-status=dead |archive-url=https://web.archive.org/web/20120319053732/http://linuxgazette.net/issue67/orr.html |archive-date=2012-03-19 }}</ref> 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 {{mono|'''cowthink'''}}, with cows with thought bubbles rather than speech bubbles. <code>.cow</code> files for cowsay exist which are able to produce different variants of cows, with different kinds of eyes, and so forth.<ref name="RMS for cowsay">{{cite web |title=A Virtual Richard Stallman for Cowsay Hack |author=Newborough, Philip |url=http://crunchbang.org/archives/2007/10/05/a-virtual-richard-stallman-for-cowsay-hack/ |date=2007-10-05 |archive-url=https://web.archive.org/web/20110725210040/http://crunchbang.org/archives/2007/10/05/a-virtual-richard-stallman-for-cowsay-hack/ |archive-date=2011-07-25}}</ref> 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.<ref name="Debian PotD">{{cite web|title=cowsay: a configurable talking and thinking cow |url=http://debaday.debian.net/2007/10/28/cowsay-a-configurable-talking-and-thinking-cow/ |date=2007-10-28 |work=Debian Package of the Day |access-date=2022-01-31 |url-status=live |archive-url=https://web.archive.org/web/20071030081644/http://debaday.debian.net/2007/10/28/cowsay-a-configurable-talking-and-thinking-cow/ |archive-date=2007-10-30 |author=Beshenov, Alexey}}</ref>

==Example== The Unix command {{mono|fortune}} can also be piped into the {{mono|cowsay}} command: <syntaxhighlight lang="shell-session"> [user@hostname ~]$ fortune | cowsay ________________________________________ / You have Egyptian flu: you're going to \ \ be a mummy. / ---------------------------------------- \ ^__^ \ (oo)\_______ (__)\ )\/\ ||----w | || || </syntaxhighlight>

Using the parameter {{mono|-f}} followed by {{mono|tux}}, one can replace the cow with other beings, such as Tux, the Linux mascot: <syntaxhighlight lang="shell-session"> [user@hostname ~]$ fortune | cowsay -f tux _________________________________________ / You are only young once, but you can \ \ stay immature indefinitely. / ----------------------------------------- \ \ .--. |o_o | |:_/ | // \ \ (| | ) /'\_ _/`\ \___)=(___/ </syntaxhighlight>

Using the parameter {{mono|-l}} shows all available cow files: <syntaxhighlight lang="shell-session"> [user@hostname ~]$ cowsay -l Cow files in /usr/share/cowsay/cows: apt bud-frogs bunny calvin cheese cock cower daemon default dragon dragon-and-cow duck elephant elephant-in-snake eyes flaming-sheep fox ghostbusters gnu hellokitty kangaroo kiss koala kosh luke-koala mech-and-cow milk moofasa moose pony pony-smaller ren sheep skeleton snowman stegosaurus stimpy suse three-eyes turkey turtle tux unipony unipony-smaller vader vader-koala www </syntaxhighlight>

==Parameters== {| class="wikitable plainrowheaders" |- ! Option ! Purpose |- ! style="font-family:monospace;" scope="row" | -n | 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 '''{{mono|-W}}'''. Only works with text from stdin. |- ! style="font-family:monospace;" scope="row" | -W | Specifies width of the speech balloon in columns, i.e. characters in a monospace font. Default value is 40. |- ! colspan="2" | |- ! style="font-family:monospace;" scope="row" | -b | “Borg mode”, uses {{mono|{{=}}{{=}}}} in place of {{mono|oo}} for the cow′s eyes. |- ! style="font-family:monospace;" scope="row" | -d | “Dead”, uses {{mono|XX}}, plus a descending {{mono|U}} to represent an extruded tongue, also used on Linux kernel oops. |- ! style="font-family:monospace;" scope="row" | -g | “Greedy”, uses {{mono|$$}}. |- ! style="font-family:monospace;" scope="row" | -p | “Paranoid”, uses {{mono|@@}}. |- ! style="font-family:monospace;" scope="row" | -s | “Stoned”, uses {{mono|**}} to represent bloodshot eyes, plus a descending {{mono|U}} to represent an extruded tongue. |- ! style="font-family:monospace;" scope="row" | -t | “Tired”, uses {{mono|--}}. |- ! style="font-family:monospace;" scope="row" | -w | “Wired”, uses {{mono|OO}}. |- ! style="font-family:monospace;" scope="row" | -y | “Youthful”, uses {{mono|..}} to represent smaller eyes. |- ! colspan="2" | |- ! style="font-family:monospace;" scope="row" | -e eye_string | Manually specifies the cow′s eye-type, e.g. {{kbd|cowsay -e ^^}} (see Eastern-style emoticon).<ref name="7F">Characters 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 {{mono|'''-e'''}} and {{mono|'''-T'''}}.</ref> |- ! style="font-family:monospace; white-space:nowrap;" scope="row" | -T tongue_string | Manually specifies the cow′s tongue shape, e.g. {{kbd|cowsay -T \(\)}} for a pair of parentheses.<ref name="7F" /> |- ! style="font-family:monospace;" scope="row" | -f cowfile | Specifies a .cow file from which to load alternative ASCII art. Accepts both absolute file-paths and those relative to the environment variable {{mono|COWPATH}}. |- ! style="font-family:monospace;" scope="row" | -l | Lists the names of available cow-files in the {{mono|COWPATH}} directory instead of displaying a quote. |}

==References== {{Reflist}} * Sandra Henry-Stocker (Dec 15, 2020). [https://www.networkworld.com/article/3601114/creating-your-own-cowsay-messenger.html "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.&nbsp;120. c't-Redaktion; Heise Medien GmbH & Co. KG. {{isbn|9783957882073}}. Retrieved 21 September 2023. * Sreenath (5 July 2023). [https://itsfoss.com/cowsay/ "Moo! There is a Cow in My Linux Terminal"]. ''It's FOSS''. itsfoss.com. Retrieved 21 September 2023.

==External links== * {{cite web|url=http://www.nog.net/~tony/warez/cowsay.shtml |title=Official website |access-date=December 25, 2004 |url-status=unfit |archive-url=https://web.archive.org/web/20120225123719/http://www.nog.net/~tony/warez/cowsay.shtml |archive-date=February 25, 2012 }} * {{F-Droid|ch.fixme.cowsay}}

Category:ASCII art Category:Free software programmed in Perl Category:Free and open-source Android software Category:Linux software Category:Unix software Category:Cattle in popular culture Category:1999 software Category:Software using the GNU General Public License