🐄 Add Colorful Cows to Your Terminal

• 1 min read • 4 votes

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.

Dependencies

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 🤗

4 cheers
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

More Posts ✍🏻

See All »
• 2 min read • 703 votes
👨🏼‍💻 Going Indie, Again
Read Post »
• 2 min read • 699 votes
🗓 2019 Year in Review: Prioritizing Health
Read Post »
• 4 min read • 4279 votes
😈 Productive Procrastination
Read Post »
• 6 min read • 401 votes
👔 Quit With Positivity
Read Post »
• 6 min read • 856 votes
🎈 Abandoning the Static Site
Read Post »
• 3 min read • 411 votes
📈 Indie to Acquisition
Read Post »
• 5 min read • 535 votes
🚀 Getting Over the Fear of Launching
Read Post »
×