lolcat: How to Customize Terminal with Colours

lolcat tutorial

lolcat tutorial guide banner image

Linux used to be boring. When people hear the word “Linux”, immediately the imagine a black and white terminal window that can be used only by tech veterans. It is not. If you have been a regular reader of Unixmen, you would know by now that Linux is fun. The only deterrent is the black and white terminal even that is handled now with lolcat. This command line utility adds a rainbow gradient to your terminal output. With this powerful yet simple utility, you can display a welcome message, echo a message, run bash scripts, and more with fun and flair.

Today at Unixmen, let us take explain how to install lolcat, customizing terminal, and some examples. Don’t worry about the overhead. It is simple, lightweight, and fun. Ready? Get. Set. Learn!

What Is lolcat?

lolcat is a small command-line utility that takes standard input (stdin) and outputs it in rainbow-ish text. It is similar to cat utility, but with added colour effects. lolcaworks on Unix based systems, including Linux, FreeBSD, and macOS. It is perfect for users who want to make their terminal output more vibrant.

Why Should I Use lolcat?

Unixmen is not only about solving Linux problems. We have some guides for fun-based utilities as well and one such utility is lolcat. Let us look at some reasons why you should try it:

  • With the increased visual appeal, you can make output more engaging or readable.
  • If you want to highlight a few scripts, you can colourize banners or headings in bash scripts.
  • You can look cool and techy. Impress your friends or make your terminal look unique.
  • A colourful terminal window is better for screencasts, tutorials, and presentations.

How to Install lolcat on Linux

Depending on your Linux distribution, there are a few different ways to install lolcat.

For Debian/Ubuntu, use apt:

sudo apt update
sudo apt install lolcat

If that command did not work (sometimes the repo is outdated), you can install it via Ruby:

sudo apt install ruby
sudo gem install lolcat

For Fedora, run this command:

sudo dnf install rubygems
sudo gem install lolcat

For Arch Linux, use this command:

sudo pacman -S ruby
sudo gem install lolcat

Basic Use Cases

Using lolcat is easy. Just use | lolcat along with the output you want. Let us start easy:

echo "Hello from Unixmen" | lolcat

Or read from a file:

cat samplefile.txt | lolcat

Use it with system commands:

figlet "Welcome" | lolcat
neofetch | lolcat
ls -l | lolcat

How to Use lolcat in Bash Scripts

Add some colours and vibrance to your bash scripts by integrating lolcat for colourful output. For example, here is a sample script:

echo "Starting script..." | lolcat
sleep 1
echo "Step 1: Done!" | lolcat

If you want, you can use figlet or toilet (both are utilities) for large ASCII text, and pipe that into lolcat.

figlet "Install Complete" | lolcat

lolcat Options

It comes with a few handy options to customize the effect:

  • -a: Animate the output
  • -d: Duration (used with `-a`)
  • -s: Speed of animation
  • -p: Frequency of rainbow colours
echo "Opening Unixmen repository..." | lolcat -a -d 2 -s 50

How to Make My Terminal Banner Colourful

Customize your .bashrc or .zshrc file to display a colourful welcome message every time you open a terminal.

Add this to ~/.bashrc:

echo "Welcome, $USER!" | lolcat

Or add a little more fun with ASCII art:

figlet "Hello $USER" | lolcat

Troubleshooting Common lolcat Errors

lolcat: command not found

You may not have Ruby installed. Use your package manager to install it:

sudo apt install ruby

Then run:

sudo gem install lolcat

Output looks weird in some terminals

Try using lolcat in a true-colour (24-bit) compatible terminal like GNOME Terminal, Konsole, or Tilix.

lolcat Alternatives

If you are looking for similar tools or want more customization, check out:

  • For ASCII text with fonts and effects: toilet
  • Simple large text banner generator: figlet
  • Makes a cow read your text (hard to believe, but yes it works): cowsay

Combine them for fun results:

cowsay "Hello from Unixmen" | lolcat

Wrapping Up

Adding some visual colours to the command line with lolcat is not just fun. It can also help emphasize key output, improve demo scripts, and make Linux a little more delightful. Whether you are customizing your shell, building scripts, or just want a bit of rainbow magic in your life, it is an easy and charming tool to have in your Unix toolbox.

Related Articles

The Linux Command Line: A Tale of Two Tools – apt and apt-get

.bashrc: The Configuration File of Linux Terminal

How to Type Emojis in Ubuntu Linux