Skip to main content

Module 10: Advanced & Security

Lesson 105: cowsay Command

In this lesson, you'll learn how to use the cowsay command to generate fun ASCII art of a cow or other animals with customizable speech bubbles in Linux.

Let's discuss another fun command for Linux called the cowsay command. As its name suggests, this command is used to generate an ASCII art representation of a cow or other animals with speech or thought bubbles containing a customizable message.

Install cowsay in Linux

To install this command on your system, execute one of the commands mentioned below based on your system's package manager.

$ sudo apt install cowsay         # Debian, Ubuntu and Mint
$ sudo yum install cowsay         # RHEL/CentOS/Fedora and Rocky/AlmaLinux
$ sudo emerge -a sys-apps/cowsay  # Gentoo Linux
$ sudo apk add cowsay             # Alpine Linux
$ sudo pacman -S cowsay           # Arch Linux
$ sudo zypper install cowsay      # OpenSUSE

cowsay Command Syntax

$ cowsay [OPTIONS] [MESSAGE]

cowsay Command Options

Option Description
-f FILE Use a specific animal or character file
-l List all available cowfiles (animals/characters)
-e EYE Set custom eyes for the cow (e.g. xx for dead eyes)
-T TONGUE Set a custom tongue for the cow
-W WIDTH Set the column width of the speech bubble
-b Borg mode (== eyes)
-d Dead mode (XX eyes)
-g Greedy mode ($$ eyes)
-p Paranoid mode (@@ eyes)
-s Stoned mode (** eyes)
-t Tired mode (-- eyes)
-w Wired mode (OO eyes)
-y Young mode (. eyes)

1. Generate ASCII Art with a Custom Message

After installation, you can try running the cowsay command by simply typing:

Pro TecMint Β· Root Plan
This Article is for Root Members
Join Root to read the full article and unlock everything

Full Access to Every Article, Course & Certification Track

Join thousands of Linux professionals who use Pro TecMint to advance their careers.

Ad-free access to all premium articles
All courses: Learn Linux, Bash, Golang, Ubuntu and more
RHCSA, RHCE, LFCS & LFCA certification prep
New courses added every month
Private Telegram community & priority support
Root Plan
$8/mo
or $59/year billed annually
Save $37 with annual plan
Start Reading This Article in the Next 60 Seconds
Join Root Plan β†’