cowsay

Print text in a speech bubble with an ASCII art character (usually a cow).

Category: Fun ASCII terminal motd fortune-friendly

Install

# RHEL / Alma / Rocky (often via EPEL)
sudo dnf install epel-release
sudo dnf install cowsay

# Debian / Ubuntu
sudo apt install cowsay

# openSUSE
sudo zypper install cowsay

# Arch
sudo pacman -S cowsay

What it does

cowsay takes text (arguments or stdin) and prints it in a speech (or thought) bubble, followed by an ASCII art figure. It’s a classic terminal “personality” tool—great for MOTD, scripts, or pairing with fortune.

How it works (mechanical)

  • Renders a bubble sized to your text (wrap width can be controlled).
  • Selects an ASCII “cowfile” (a template stored on disk) to draw the character.
  • Outputs plain text (no colors by default), so it’s safe to pipe into other tools.

Quick Start

# Say something
cowsay Hello, world!

# Read from stdin
echo "Server reboot at 02:00" | cowsay

# Pair with fortune
fortune -s | cowsay

10 Practical Examples

  1. Basic usage
    cowsay "Moo."
  2. Use stdin
    echo "Patch window tonight" | cowsay
  3. Thought bubble
    cowsay -T "U " -W 40 "Thinking..."

    Tip: Many distros provide cowthink as a companion command.

  4. Set wrap width
    cowsay -W 30 "This will wrap at 30 columns."
  5. No word wrap
    cowsay -n "Keep my spacing exactly as typed."
  6. List available cowfiles
    cowsay -l
  7. Pick a specific cowfile
    cowsay -f tux "Linux approved."
  8. Random cowfile (shell)
    # Pick a random cowfile name
    cowsay -l | tail -n +2 | tr ' ' '
    ' | sed '/^$/d' | shuf -n 1

    Then use it with -f, e.g. cowsay -f <name> "...".

  9. “Borg mode” / “dead” / “greedy” / “paranoid” etc.
    cowsay -b "Resistance is futile."
    cowsay -d "I'm dead tired."
    cowsay -g "I want snacks."
    cowsay -p "Who's behind me?"

    These flags tweak the cow’s eyes/tongue.

  10. Fortune + cowsay in your shell greeting
    # Add to ~/.bashrc (or ~/.zshrc)
    fortune -s | cowsay

Notes & Gotchas

  • Package names vary: some distros ship cowsay plus extra cowfiles in a separate package.
  • Where cowfiles live: commonly under /usr/share/cowsay/cows (varies by distro).
  • Script safety: output is plain text; watch for quotes/newlines if you’re embedding inside other scripts.
  • Wide terminals: if bubbles look odd, set an explicit wrap with -W.

Historical Context

cowsay began as a playful UNIX/Linux terminal program (popularized on Debian and beyond) and became a beloved “geek culture” staple. It’s one of those tiny tools that makes the command line feel alive.

Modern Equivalent

No strict replacement needed—cowsay is still the go-to for ASCII speech bubbles. Modern equivalents are mostly variations: other ASCII art generators, prompt frameworks, or MOTD scripts that combine multiple text effects.

Related Commands

  • fortune — feed quotes into cowsay.
  • lolcat — colorize cowsay output.
  • figlet / toilet — big ASCII banners.
  • banner — classic banner text.