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
- Basic usage
cowsay "Moo."
- Use stdin
echo "Patch window tonight" | cowsay
- Thought bubble
cowsay -T "U " -W 40 "Thinking..."
Tip: Many distros provide
cowthinkas a companion command. - Set wrap width
cowsay -W 30 "This will wrap at 30 columns."
- No word wrap
cowsay -n "Keep my spacing exactly as typed."
- List available cowfiles
cowsay -l
- Pick a specific cowfile
cowsay -f tux "Linux approved."
- 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> "...". - “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.
- Fortune + cowsay in your shell greeting
# Add to ~/.bashrc (or ~/.zshrc) fortune -s | cowsay
Notes & Gotchas
- Package names vary: some distros ship
cowsayplus 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.