🐄 Add Colorful Cows to Your Terminal

• 1 min read

Have you ever wanted to see a random, funny and colorful message every time you launch your terminal? Well I did, and and here’s how you can do it too.


How To

Just add this one-liner to your .bashrc and you’re all set!

# Fancy pants one-liner
fortune | cowsay -f $(node -e "var c='$(cowsay -l)'.split('  ');console.log(c[Math.floor(Math.random()*c.length)])") | lolcat --seed 0 --spread 1.0

Here’s a slightly more comprehensible version of the same code.

# Randomly select a cow name
cow=$(node -e "var c='$(cowsay -l)'.split('  ');console.log(c[Math.floor(Math.random()*c.length)])")

# Or, if you have shuf (or gshuf) installed
#  cow=$(shuf -n 1 -e $(cowsay -l))

fortune | cowsay -f "$cow" | lolcat --spread 1.0

If you enjoyed this tutorial, please consider sponsoring my work on GitHub ðŸĪ—

Now look what you've done 🌋
Stop clicking and run for your life! ðŸ˜ą
Uh oh, I don't think the system can't handle it! ðŸ”Ĩ
Stop it, you're too kind 😄
Thanks for the love! âĪïļ
Thanks, glad you enjoyed it! Care to share?
Hacker News Reddit


Recommended Posts ✍ðŸŧ

See All »
• 3 min read
⛰ïļ 2022 Recap: Getting Physical
Read Post »
• 5 min read
ðŸŠī Home-Grown Web Analytics
Read Post »
• 2 min read
ðŸ‘Ļ🏞‍ðŸ’ŧ Going Indie, Again
Read Post »