3 interesting ways to use the Linux cowsay command | Opensource.com

3 interesting ways to use the Linux cowsay command

Want a just-for-fun application to play with? Try cowsay.

Cow on parade.
Image by : 
Opensource.com
x

Subscribe now

Get the highlights in your inbox every week.

Most of the time, a terminal is a productivity powerhouse. But there's more to the terminal than commands and configurations. Among all the outstanding open source software out there, some of it has been written just for fun. I've written about fun commands before, but this article is about just one: the venerable cowsay command.

Cowsay is a configurable talking (or thinking) cow. It accepts a text string and outputs a graphic of a cow talking. Here's a cow saying it loves Linux:

< I love Linux >
--------------
       \   ^__^
        \  (oo)\_______
           (__)\       )\/\
               ||----w |
               ||     ||

To get that result, all I have to type is:

$ cowsay "I love Linux"

Install cowsay on Linux

You can install cowsay with your package manager. On Debian, Mint, Elementary, and similar distributions:

$ sudo apt install cowsay

On Fedora:

$ sudo apt install cowsay-beefymiracle

Cowsay command options

Cowsay is a simple and silly application. There's no actual use for it except to provide some diverting styling for your terminal. For instance, rather than just making a cow say a fun phrase, you can make a cow with wonky eyes say a fun phrase. Type:

$ cowsay -e @@ Hello

You'll get:

< Hello >
 -------
       \   ^__^
        \  (@@)\_______
           (__)\       )\/\
               ||----w |
               ||     ||

Or you can make it stick out its tongue. Type:

$ cowsay -T U Hello

You'll see:

< Hello >
-------
       \   ^__^
        \  (oo)\_______
           (__)\       )\/\
            U ||----w |
               ||     ||

Better still, you can combine the fortune command with cowsay:

$ fortune | cowsay

Now you'll have an especially smart cow:

 _______________________________________
/ we:                                   \
|                                       |
| The single most important word in the |
\ world.                                /
 ---------------------------------------
       \   ^__^
        \  (oo)\_______
           (__)\       )\/\
               ||----w |
               ||     ||

Beefy miracle

On Fedora, there's an extra option for cowsay that's also an unofficial project mascot. For years, the Fedora installer has displayed slides promoting open source contributions. Because they were styled after the interludes at drive-in movie theaters, a common cartoon character in the slides is an anthropomorphic hot dog.

In keeping with that theme, you can invoke a so-called beefy miracle with the Fedora version of cowsay:

$ cowsay -f beefymiracle Hello Fedora

You'll end up with a perfectly silly result:

< Hello Fedora >
 --------------      .---. __
          ,    \    /     \   \    ||||
         \\\\      |O___O |    | \\||||
         \   //    | \_/  |    |  \   /
          '--/----/|     /     |   |-'
                 // //  /     -----'
                //  \\ /      /
               //  // /      /
              //  \\ /      /
             //  // /      /
            /|   ' /      /
            //\___/      /
           //   ||\     /
           \\_  || '---'
           /' /  \\_.-
          /  /    --| |
          '-'      |  |
                    '-'

Graphical cowsay

If you find yourself needing to have messages delivered to you from a graphical cow, there's the xcowsay command. It's a graphical program similar to cowsay, and it accepts a text string that's entered by the user or piped from another application like Fortune.

Fun Linux commands

While cowsay is not a useful command, it is a fun command—the equivalent of desktop widgets for your terminal. It's great for a momentary distraction and fun experiments with piping commands (try piping ifconfig to cowsay, or lsblk, or mount, or anything!). If you want to make your terminal more fun, try cowsay.

Pumpkins painted for Day of the Dead

Celebrate the Day of the Dead using this fun Linux command-line tool.
Woman sitting in front of her laptop

These playful Linux commands are also surprisingly useful.
Linux toy: fortune

Bring quotes and quips to the command line with the fortune utility.

About the author

Don Watkins - Educator, entrepreneur, open source advocate, life long learner, Python teacher. M.A. in Educational Psychology, MSED in Educational Leadership, Linux system administrator, Follow me at @Don_Watkins .