How To Install cowsay
The cowsay utility command is available on the package manager, and you can install it with the following command:
There are different options to use with cowsay. You can start with a welcome message, as shown below:
You can use different flags to play around with the cowsay. For instance, you can use the “-e @@” options to add wonky eyes to the cow. To make the cow stick out its tongue, use the “-T U” options. The “@@” are characters, and you can replace them with any character that fits your cow’s eyes.
Listing Available Art Types
There are different art types that you can use with cowsay. To view the complete list, use the “-l” option.
You can also list all the cow art types using the following command:
You can use any of the art types in place of the cow. For instance, let’s play with the turkey to see the output. To select an art type, use the “-f” option.
You can choose any art type, which will display with the input words you give. Moreover, it’s possible to print a pretty cow or any art type saying text from stdin. Combine cowsay with echo.
Different cowsay Mind States
As we’ve seen, the cow can say any message fed to it. However, you can also add different states of mind to create more entertainment. There are eight states of mind that you can use. Let’s see some examples.
1. Paranoia
If you want to depict the paranoia mode of the cow, use the “-p” option.
2. Dead
A dead state of mind of the cow shows “XX” and can be depicted using “-d”.
3. Borg Mode
A Borg mode is represented by the “-b” option.
4. Wired
For a wired state, use “-w”.
5. Youthful
The “-y” shows an energetic and youthful state of mind.
6. Tired
Even cows get tired. You will have a tired cow using the “-t” option.
7. Greedy Mode
The greedy mode, “-g”, adds dollar signs in the cow’s eyes.
8. Stoned
For a stoned state, use the “-s” option
Combining cowsay With Fortune
Using the fortune utility that prints fortune messages, you can add more fun to your cowsay. If you don’t have fortune installed, use the following command:
Instead of adding the input text, pipe the fortune output to cowsay.
Now, you have your pretty cow speaking your fortune message. Amazing!
Even with fortune, you can still play around with different art types.
Conclusion
When you work with Linux and need a break, playing with cowsay is an option. The utility lets you create different cowsay art and define which message and state of mind they should give. Furthermore, we’ve seen how you can combine cowsay with the fortune utility to spice the fun. With the examples above, you should be able to create your art and play with the available options. Get creative and have fun!