Fact-checked by Grok 2 weeks ago

cowsay

Cowsay is a configurable command-line program that generates pictures of a cow with a speech bubble containing a user-provided message, often used to add humor to output on systems. It functions as a text filter, accepting input from standard input or command-line arguments, and can be paired with tools like to render the message in stylized text. Originally developed in by Tony Monroe, cowsay draws inspiration from the cow-themed culture of the Undergraduate Association (CSUA) at the , where simple ASCII cows were a longstanding . Monroe first released the program in 1999, with early versions enhancing basic cow art by adding expressive features like "thinking" poses via the companion tool cowthink. The software requires 5 and includes customizable "cowfiles" for different animals or characters, such as tux (a penguin) or dragon, allowing users to select from dozens of predefined templates. After Monroe's final release (version 3.04), the project saw limited maintenance until 2016, when Janke forked it to address bugs and improve compatibility, leading to the current under the GNU General Public License version 3. This , now at version 3.8.4, supports modern systems and has inspired ports in languages like , , and , preserving cowsay's whimsical utility in developer workflows. Despite its silliness, cowsay remains a cultural staple in open-source communities, symbolizing the playful side of command-line computing.

History

Origins and Development

Cowsay was originally developed by Tony Monroe, a software developer active in the Unix and open-source communities, as a lightweight Perl script designed to inject humor into command-line interfaces. Released in 1999, the program generates ASCII art of a cow (or other figures) delivering user-specified messages in speech bubbles, serving as a configurable novelty tool. Cowsay was inspired by simple ASCII cows that were a longstanding meme in the Computer Science Undergraduate Association (CSUA) at the University of California, Berkeley, with suggestions from Shannon Appel and contributions from Anthony Polito. Monroe's creation emerged from the vibrant scripting culture of the late 1990s, a period when dominated as the go-to language for quick, expressive scripts on systems, often used for web applications, system automation, and whimsical utilities that enhanced developer workflows. Written entirely in , cowsay exemplified this culture's emphasis on practicality blended with fun, allowing users to customize outputs for comic relief during scripting sessions or log reviews. The initial version operated under the , 's default permissive license, which was later supplemented with dual licensing under the GNU General Public License to broaden compatibility with distributions. Early distribution occurred primarily through Monroe's personal , where the source code and binaries were made available for , fostering among and BSD users. By the early , cowsay had gained enough popularity to be packaged and included in major distributions, such as , marking its transition from a personal project to a standard utility in open-source ecosystems. This organic spread highlighted its appeal as a simple yet endearing addition to the toolkit of programmers seeking to humanize (or bovine-ize) their terminal experiences.

Key Releases and Maintenance

Cowsay was first publicly released in 1999 by its original author, Tony Monroe, with early versions featuring basic functionality such as a single cow and simple message templates. Subsequent development led to version 2, which introduced support for arbitrary messages, multiple cow files, and integration with for banner text generation. By version 3.0, the program underwent a complete rewrite in 5, resulting in more compact and maintainable code while enhancing overall features like improved modularity. The original project reached its final release under Monroe with version 3.04 in 2016, after which maintenance ceased. In 2016, Andrew Janke created an active to address ongoing needs, including bug fixes and compatibility improvements for modern systems; this , hosted at github.com/cowsay-org/cowsay, became the primary source for distributions like Homebrew. The latest stable release as of November 2025 is version 3.8.4, released on December 1, 2024, which includes updates for compatibility and minor fixes to ensure reliability on contemporary environments. Licensing for cowsay has evolved to align with Perl's terms, initially distributed under the Artistic License. Later versions incorporated dual licensing with the GNU General Public License version 2 or later (GPL v2+), providing greater compatibility for redistribution and integration in various software ecosystems. New contributions since the fork are explicitly dual-licensed under GPL v1+ or Artistic License 1.0 to encourage community involvement.

Functionality

Core Mechanism

The cowsay program, implemented as a script, reads input text either from standard input when invoked without arguments or directly from command-line arguments provided by the user. It processes this input by word-wrapping the text to a default width of 40 characters to fit the output layout, preserving the message's readability within the ASCII constraints; this wrapping can be disabled to maintain original whitespace but is essential for standard operation. The wrapped text is then formatted into an ASCII art bubble: a speech bubble positioned to the side of the animal for the cowsay command, or a thought bubble placed above the animal for the cowthink variant, with the latter using a trail defined in the template file. This differentiation allows cowsay to simulate spoken messages emerging from the animal's mouth area, while cowthink evokes internal monologue emerging from the head. Animal rendering relies on template files with the .cow extension, which contain code executed by the program to define the core structure. These files assign a multi-line string to the the_cow variable for the animal's body, along with optional variables such as eyes (defaulting to "oo"), tongue (defaulting to a space), and thoughts for the bubble connector; the program overlays the message bubble onto this rendered figure, typically aligning it to the right side relative to the animal's orientation. The entire output is generated as and directed to standard output, enabling seamless piping to other commands without any graphical dependencies.

Command-Line Parameters

Cowsay provides a range of command-line parameters to customize the output, including selections for animal files, message formatting, and modifications to the ASCII art's expressions and features. These options allow users to tailor the cow's appearance and the speech balloon's style without editing the underlying cow files. The parameters are processed from left to right, with any remaining arguments treated as the message text or read from standard input if none are provided. Core options enable basic configuration of the animal and message layout. The -f <file> parameter specifies a particular cow picture file from the available .cow files, such as -f dragon to use a dragon that includes fire breath in its ASCII art. The -l option lists all defined cow files available on the current COWPATH. The -W <width> parameter sets the column width for word-wrapping the message, defaulting to 40 columns if unspecified. Expression controls alter the cow's facial features to convey different moods through predefined eye and tongue changes. The -b option invokes Borg mode, producing a cow resembling a Borg with adjusted eyes. The -d option sets , making the cow appear lifeless. The -g option enables greedy mode, changing the eyes to look avaricious. The -s option creates a stoned appearance with droopy eyes and a . The -t option yields a tired cow with half-closed eyes. The -y option displays a youthful cow with wide, innocent eyes. Additional parameters modify the balloon, wrapping behavior, and other elements. The -n option disables word-wrapping, allowing the full message to display without breaks, which is useful for embedding other ASCII art. The -p option induces paranoia mode, altering the cow's expression to look suspicious. The -T <tongue> parameter specifies a custom two-character tongue string, overriding defaults like the "U" in stoned mode. Using -f dragon also activates a special mode where the dragon exhales fire in the artwork. Utility flags provide direct and . The -e <eyes> option sets the cow's eyes using a two-character string, defaulting to "oo" for normal wide eyes; for example, -e XX produces dead eyes. The -v option displays version about the cowsay installation. These options can be combined, such as with the fortune command for random messages, but detailed integrations are covered elsewhere.

Usage Examples

Basic Output Examples

The basic output of cowsay demonstrates its core functionality by generating an cow with a speech bubble containing the provided message, using the default cow design from the default.cow file. When invoked with a short message like cowsay "Hello, world!", the program produces a speech bubble above the cow, with the text centered and padded within the bubble's width.
 _____________
< Hello, world! >
 -------------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||
The cowthink variant, invoked as cowthink "The cow is thinking.", modifies the output to use a thought bubble instead of a speech bubble, placing the message within rounded parentheses above the cow while retaining the default animal design. This illustrates the program's ability to differentiate between speaking and thinking modes through bubble styling.
 (The cow is thinking.)
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||
When no is provided on the command line, cowsay reads input from standard input (stdin), automatically word-wrapping long lines at approximately 40 columns by default to fit the . For example, piping a multi-line via echo -e "This is the first line.\nThis is the second line." | cowsay preserves the newlines in the , padding shorter lines with spaces to align with the longest line's width, resulting in a multi-line speech . Similarly, a long single line input wraps across multiple lines if it exceeds the wrap width.
 _____________________
< This is the first   >
< line.               >
< This is the second  >
< line.               >
 ---------------------
       \   ^__^
        \  (oo)\_______
           (__)\       )\/\
               ||----w |
               ||     ||
To explore available built-in cow files beyond the default, the command cowsay -l lists the herd of ASCII art options installed in the system's cow directory, such as default, tux (a penguin), and milk (a milking cow), printed in a human-readable format for terminal use. This output helps users identify basic animal variants without customization.
Cow files in /usr/share/cowsay/cows/:
	apt		beavis.zen		bud-frogs		bunny
	cheese		cock			cow			default
	dragon		elephant		eyes			flaming-sheep
	ghostbusters	head-in			hellokitty		kiss
	kitty		koala			kosh			luke-maul
	mech-and-cow	milk			moofasa			moose
	mutilated	pony			ren			sheep
	skeleton	 small			stegosaurus		stimpy
	superman	 surgery			three-eyes		turkey
	turtle		tux			unipony			unizoid
	vader-koala	 vader			www

Customized and Multi-Animal Examples

Cowsay allows users to modify the cow's facial expression through dedicated options for eyes and tongue, enabling a range of emotional or whimsical depictions. The -e option sets the eyes using the first two characters of the provided string, overriding the default "oo" to create effects like surprised (^^) or squinted (--) expressions, while the -T option similarly configures the tongue with two characters, which only displays in modes where it is visible, such as dead or stoned. Predefined modes further simplify variations: for example, the -b (Borg) mode uses "==" for eyes and "U" for tongue, and the -g (greedy) mode employs "$$" for eyes to suggest avarice. Combining these options yields hybrid expressions; the command cowsay -t -g "Tired and greedy" can result in a cow with greedy eyes ("$$", overriding tired "--") and default (none), blending fatigue with material desire for humorous effect, though mode combinations may lead to overrides. Similarly, direct customization like cowsay -e "xx" -T "\\|" "Exasperated outburst" produces crossed eyes and a clenched (if visible in the mode), evoking . Beyond the default cow, cowsay supports alternative animal templates via the -f option, which loads from .cow files containing predefined shapes—these files define the body, eyes, and tongue positions for variety (as detailed in Built-in Cow Files). For instance, cowsay -f tux "[Linux](/page/Linux) penguin speaks" displays Tux, the penguin, with a speech bubble, substituting the cow's form while retaining the messaging mechanism. The template adds dramatic flair: cowsay -f dragon "Fire-breathing message" renders a fiery with integrated flame graphics in the , enhancing the visual impact of warnings or exclamations. Multiple parameters can be layered for refined outputs, adjusting and simultaneously. The command cowsay -f bunny -W 20 -p "Poncy rabbit balloon" uses the bunny template, narrows the speech bubble width to 20 columns with -W, and applies paranoid mode (-p) for "@@" eyes, creating a nervous, compact in a floating balloon-like . This combination is useful for space-constrained terminals or themed presentations. If an invalid .cow file is specified with -f, cowsay terminates with an , such as "cowsay: Couldn't open cowfile `invalid.cow'", preventing execution and alerting users to check available files via the -l option.

Variants and Implementations

Built-in Cow Files

The built-in cow files in cowsay consist of predefined ASCII art designs stored as .cow files within the program's original Perl distribution and its maintained forks. These files define various animals and figures that can be rendered alongside user messages, providing thematic variety to the output. Each .cow file is structured as a simple block of Perl code that assigns a multiline ASCII string to the variable $the_cow, which outlines the figure's body, head, legs, and other parts using placeholders for dynamic elements like eyes ($eyes), tongue ($tongue), and the thoughts or speech balloon trail ($thoughts). Backslashes, at signs, dollar signs, and certain other characters within the ASCII art must be escaped to ensure proper parsing by the Perl interpreter. This format allows for modular customization while maintaining compatibility across implementations. The default cow, defined in default.cow, portrays a basic four-legged bovine with straightforward circular eyes and an optional protruding tongue, embodying the program's core humorous aesthetic as a simple, anthropomorphic farm animal delivering the message. Among the themed built-in files, several draw from animals, mythical creatures, and cultural icons to expand creative options. For instance, tux.cow features the Linux mascot Tux as a plump penguin waddling on ice, dragon.cow depicts a fierce, fire-breathing dragon with wings and flames, bunny.cow shows a cute rabbit with long ears and a fluffy tail, milk.cow illustrates a cow in the midst of being milked with attached udder details, ghostbusters.cow renders a spectral, translucent ghost figure, sheep.cow presents a woolly sheep with curved horns, and bud-frogs.cow displays a pair of frogs perched together in a whimsical pose. These designs, contributed over time to the original project by Tony Monroe and community members, highlight diverse motifs from nature to pop culture. Modern forks and distributions of cowsay include approximately 50 built-in .cow files, an expansion from the smaller set in the initial Perl release, enabling users to select from a broader palette while supporting easy extension through additional user-supplied files placed in the cows directory.

Ports and Forks in Other Languages

A Python port of cowsay, available as the cowsay package on PyPI since 2017, replicates the original Perl program's core functionality including ASCII art generation and command-line interface support, and can be installed via pip install cowsay. The implementation by piuccio, hosted on since the early 2010s, translates the original code to support environments and browser usage, with features like customizable eyes and tongue, and includes online demonstration capabilities through integration. In , the cowsay package on CRAN, developed by Scott Chamberlain and first released in 2014, enables printing messages, warnings, or strings alongside ASCII animals within sessions, facilitating fun integrations in workflows such as console outputs during analysis. Community forks extend the original, such as Andrew Janke's maintenance fork under the cowsay-org organization on , which adds pluggable third-party cow collections, and is distributed via Homebrew for macOS and with brew install cowsay. Web-based adaptations include cowsay.morecode.org, a service providing an online interface and for generating cow messages via GET or requests with parameters for text and format, allowing programmatic access without local installation. Ports introduce extensions like additional animals; for instance, the version includes over 50 creatures, such as alligators, bats, dragons, and yodas, stored as separate .cow files for easy expansion. For Windows compatibility, cowsay runs via , a emulation layer, where users can install it manually by extracting pre-built tarballs or compiling from source after setting up required dependencies.

Cultural Impact

Role in Hacker and Open-Source Culture

Cowsay emerged as a beloved tool in early and open-source communities, gaining widespread attention through a feature article in the Linux Gazette issue #67 in June 2001, which described it as a configurable program for generating humorous in terminals. This exposure helped solidify its place as a lighthearted addition to systems, appealing to developers and enthusiasts who appreciated its simplicity and silliness amid more utilitarian software. As a of open-source whimsy, cowsay exemplifies scripting that injects fun into command-line workflows without compromising functionality; it has been packaged and distributed in prominent distributions, including since at least 2004 and , making it readily available to millions of users worldwide. The tool's inclusion in these repositories underscores its role in fostering a playful within open-source development, where such novelties contrast with the rigor of system administration and programming. The open-source community has sustained cowsay's vitality through collaborative contributions, particularly by creating and sharing custom .cow files that define new animal or character appearances; these are hosted in dedicated repositories, such as collections of alternative cows on , allowing users to extend the program's creativity beyond its original 47 built-in files. System administrators have further integrated cowsay into scripts for entertaining notifications, often piping outputs from commands like fortune or system queries to generate visually engaging messages in terminals.

Modern Applications and Extensions

In contemporary scripting environments, cowsay remains a lightweight tool for enhancing output through with utilities like , which generates random quotes displayed via the cow's speech bubble, adding whimsy to sessions. This integration, often automated in shell profiles such as .bashrc, provides dynamic, motivational messages upon launch. Additionally, cowsay appears in and (CI/CD) pipelines, particularly in Actions workflows, where it visualizes build statuses or deployment confirmations in tutorial demonstrations, making abstract processes more engaging for learners and teams. Educationally, cowsay serves as an accessible in programming tutorials and introductory Unix courses, illustrating concepts like standard input/output redirection and generation without requiring complex syntax. Instructors use it to demonstrate —such as combining it with system commands like or —to create visually appealing outputs that reinforce command-line fundamentals, fostering interest among beginners in environments. Its simplicity allows integration into broader curricula on shell scripting, where students customize cow files to explore file handling and text manipulation. Web-based extensions have proliferated through ports, enabling dynamic content generation in browsers without native access. The cowsay package, a direct translation of the original program, powers online tools that render cow client-side for interactive web applications. For instance, like the Deno-based cowsay service on accept POST requests with text payloads, returning formatted art for embedding in web pages or real-time chat interfaces. Dedicated generators, such as those at cowsay.morecode.org and cowsay-svelte.vercel.app, allow users to input messages and export results as text or images, extending cowsay's utility to non-terminal contexts like or . As of 2025, cowsay integrates into containerized workflows via images, such as grycap/cowsay, which combines it with for automated, humorous outputs in deployment scripts or testing environments, simplifying fun additions to . Mobile adaptations further broaden accessibility, with apps on , , and the replicating the core functionality—generating customizable from user text—for on-the-go sharing via screenshots or clipboard export. These ports in languages like , as detailed in prior implementations, facilitate such cross-platform extensions.

References

  1. [1]
    cowsay - FreeBSD Manual Pages
    Cowsay generates an ASCII picture of a cow saying something provided by the user. If run with no arguments, it accepts standard input.
  2. [2]
    cowsay and cowthink
    ### Summary of cowsay from Tony Monroe's Page
  3. [3]
    Cowsay
    Cowsay was originally written by Tony Monroe. The cowsay-org updates primarily provide maintenance, hosting, and deployment support. The main functionality and ...
  4. [4]
    apjanke's fork of the classic cowsay project - GitHub
    Cowsay is actually a pretty old program. It was originally written by Tony Monroe and was first released in 1999, but was in use by Monroe for quite a while ...
  5. [5]
    cowsay - PyPI
    May 8, 2017 · A python API/console script for the famous cowsay-linux. cowsay for GNU/Linux was initially written in perl by Tony Monroe (tony@nog.net), with ...Missing: program | Show results with:program
  6. [6]
    The history of ASCII Art
    Tony Monroe releases cowsay, a command-line utility where an ASCII-style cow ... This comprehensive timeline traces ASCII's development from its origins in 1961 ...
  7. [7]
    Perl, the first postmodern computer language
    Mar 9, 1999 · Perl programming is unabashedly genre programming. It has conventions. It has culture. Perl was the first computer language whose culture was ...
  8. [8]
    Debian -- Details of source package cowsay in bookworm
    The following binary packages are built from this source package: cowsay: configurable talking cow; cowsay-off: configurable talking cow (offensive cows). Other ...Missing: history inclusion date
  9. [9]
    GitHub - tnalpgge/rank-amateur-cowsay: Fork me if you want to maintain cowsay.
    ### Summary of Release History for Original cowsay by Tony Monroe
  10. [10]
    File: LICENSE - cowsay - Debian Sources
    cowsay License ============== cowsay is distributed under the same licensing terms as Perl: the Artistic License or the GNU General Public License. ... License ...Missing: history | Show results with:history
  11. [11]
  12. [12]
    cowsay(1) - Arch manual pages
    This mechanism allows third-party cow collections to register themselves with cowsay in a way that does not require per-user configuration. The path files ...Missing: core | Show results with:core
  13. [13]
    cowsay(1): configurable speaking/thinking cow - Linux man page
    Cowsay generates an ASCII picture of a cow saying something provided by the user. If run with no arguments, it accepts standard input, word-wraps the message.
  14. [14]
    cowsay man - Linux Command Library
    cowsay is a whimsical command-line utility that generates ASCII art pictures of a cow (or other specified animals) saying a message. It takes input text, wraps ...Missing: page | Show results with:page
  15. [15]
    Using Cowsay Linux Command Like a Pro - It's FOSS
    Jul 5, 2023 · The cowsay is a fun little Linux command line utility that can be enjoyed in so many ways. Here are several examples.
  16. [16]
    Making Linux ASCII Art with the 'cowsay' Command - IOFLOOD.com
    Dec 11, 2023 · In this example, we've used the 'cowsay' command to make an ASCII art cow say 'Hello, world!'. The command 'cowsay' is followed by the ...
  17. [17]
    cowsay 3.8.4-1 (any) - File List - Arch Linux
    cowsay 3.8.4-1 File List. Package has 55 files and 8 directories. Back to Package. usr/; usr/bin/ ...
  18. [18]
    cowsay is a configurable talking cow - GitHub
    cowsay is a configurable talking cow, originally written in Perl by Tony Monroe. This project is a translation in JavaScript of the original program.
  19. [19]
    cowsay w/ more animals, in R - GitHub
    cowsay was originally written by Tony Monroe, with the first code released in 1999. The version of cowsay you get via homebrew is a fork by Andrew Janke at ...
  20. [20]
  21. [21]
    cowsay - Homebrew Formulae
    Also known as: cowthink. Apjanke's fork of the classic cowsay project. https://cowsay.diamonds. License: GPL-3.0-only.
  22. [22]
    The cow says "moo..." - cowsay Online
    cowsay Online is a web-enabled cowsay and API providing all of your online cowsaying needs.
  23. [23]
    How to install cowsay for Cygwin - Code Yarns ‍ - WordPress.com
    Jul 26, 2013 · Cygwin needs the bzip2 and tar utilities installed. 1) Download the file from https://storage.googleapis.com/google-code-archive-downloads/v2/ ...Missing: compatibility | Show results with:compatibility
  24. [24]
    cowsay--ASCII Art for Your Screen LG #67 - Linux Gazette
    cowsay is a configurable talking cow, written in Perl. It draws an ASCII cow with a speech balloon (or a think balloon) saying whatever pithy comment you give ...
  25. [25]
    cowsay - Fedora Packages
    cowsay is a configurable talking cow, written in Perl. It operates much as the figlet program does, and it is written in the same spirit of silliness.
  26. [26]
  27. [27]
    3 interesting ways to use the Linux cowsay command
    Nov 17, 2021 · Cowsay is a configurable talking (or thinking) cow. It accepts a text string and outputs a graphic of a cow talking.Missing: mechanism | Show results with:mechanism
  28. [28]
    Linux terminal highlights: Going beyond cowsay - Red Hat
    Jul 2, 2019 · Cowsay is an udderly fantastic utility that takes text and outputs it as the spoken text of an ASCII-art bovine.
  29. [29]
    bespinian/cowsay-in-the-cloud: A tutorial for teaching kids ... - GitHub
    If you navigate to the actions tab in GitHub you can see that the pipeline starts running and re-deploys the application with the changes you have just pushed.
  30. [30]
    6. User Customization and Shenanigans - Princeton CST
    In this tutorial we will briefly learn about customizing our command line experience, then we will learn to script together commands we have learned so far.
  31. [31]
    Fun unix basics with fortune and cowsay - DEV Community
    Sep 26, 2019 · The following exercise is intended to provide some simple enjoyment and cover some some unix command line concepts.
  32. [32]
  33. [33]
    cowsay is an api that returns your text with a cow! - GitHub
    Let's build a COWSAY API, COWSAY is a program that takes some text as input and returns an ASCII rendering of a cow with a bubble enclosing the text.
  34. [34]
    cowsay Online
    cowsay Online is a web-enabled cowsay and API providing all of your online cowsaying needs.Missing: distribution | Show results with:distribution
  35. [35]
    None
    No readable text found in the HTML.<|control11|><|separator|>
  36. [36]
    Cowsay | F-Droid - Free and Open Source Android App Repository
    Oct 10, 2012 · Cowsay will turn text into happy ASCII cows, with speech (or thought) balloons. If you don't like cows, ASCII art is available to replace it with some other ...
  37. [37]