Summary

Any Linux enthusiast will tell you all the fun takes place in the terminal. Unfortunately, the standard terminal text or output text from commands can often feel dull and boring. But not anymore. With the delightful lolcat tool, you can now change your terminal output into a colorful rainbow display.

What Is the lolcat Command?

lolcat is a command-line tool that works much like thecat command. However, it adds a fun twist by applying the vibrant rainbow effect to your terminal text. In short, lolcat reads your standard input, character by character, and assigns a rainbow color to each.

With lolcat, you can turn your simple text into something that really pops, adding a playful touch or highlighting key details in your terminal output.

Listing files and directories of Ubuntu Linux in colored output using lolcat.

To get started with lolcat, you need to install it first. You can use your default package manager to set it up on your Linux system.

However, be aware that there are two different versions available to you. The original, which includes more features such as the animation flag, is available as a Snap package or through the apt package manager on Debian-based systems. If youhave snapd installed, you can open your terminal and type:

Displaying file content in colored output on Linux terminal using lolcat command.

If you are an Ubuntu or Debian-based user, you may install the original using this command:

The more widely available version, however, uses less space and functions basically the same but lacks some of the extra features. You can also install it as a snap by typing:

Getting system information in rainbow colored format using neofetch and lolcat.

If you’re running Fedora or CentOS, you’ll want to use:

And for those of you rocking Arch Linux or Manjaro:

Setting up an alias for the ls -l command in the ~/.bashrc file.

Once you’ve installed lolcat, you’re ready to use it and apply rainbow colors to your output text.

lolcat Command Options

While the default lolcat behavior is already pretty awesome, there are a few options to tweak the output to your liking. For example, with these various flags, you can adjust the pattern of rainbow colors, modify the speed, and change a few other settings.

Now, let’s look at some of the most useful options in the original version:

Displaying files and directories in long colored format using the alias lolls.

Description

-a or –animate

Animate the colors so that they move across the text over time.

Displaying ASCII text banner in rainbow colored format using figlet and lolcat command.

-p or –spread

Adjust the spread of the color gradient.

-d or –duration

Set the duration of the animation. For example, -d 0.1 will make the colors change every 0.1 seconds.

Displaying an ASCII text banner in the terminal with a rainbow-colored format and using a slant font.

-s or –speed

Controls how fast your text grooves across the screen. A higher number means faster color changes.

Displaying a rainbow-colored cow in the terminal window with some text.

-f or –freq

Use this flag to specify the frequency of the color pattern. (default: 0.1)

Displaying a rainbow-colored tux in the terminal window.

-S or –seed

Use this option to set a random seed and get a whole new color pattern.

You can view all these and other options of lolcat (and the newer version’s differing flags) by running this:

Alternatively, you can use theman pageof lolcat to find out all the important details.

Get Colored Terminal Output

Now that you’re familiar with the lolcat command and its options, let’s see how you can use it to get colored terminal output. One of the easiest ways to use lolcat is topipe the outputof another Linux command through lolcat. For instance, if you want to colorize the output of thels command, you can run this:

This will display the list of files and directories in a beautiful, rainbow-colored format. In the same way, you can apply lolcat to any command, such asgrepor man, and colorize its output text.

Let’s display the contents of a file in a rainbow spectrum using lolcat:

Want to see your system information usingneofetchin rainbow glory? Try running this:

you’re able to alsocreate a permanent aliasfor a frequently used command to automatically output in vibrant colors. For example, you can permanently set up an alias for the ls -l command by adding the following line to the~/.bashrc file:

Simply open the ~/.bashrc file in Vim:

After creating the alias, don’t forget to log out and back in to apply the changes.

Now, when you typelolls, the system will execute the command ls -l and pipe its output to lolcat for a colorful display.

Animate Your Text Using lolcat

Why settle for static colors when you can animate them? One of the most entertaining features of lolcat is its ability to animate text, making it feel like the colors are dancing across your terminal. To animate the output, simply add the -a or –animate flag:

Unfortunately, the animate flag only works in the original lolcat. If you’re using the newer version, this flag will result in a “No such file or directory” error.

The text will remain static, but the colors will continuously shift across the text, creating a mesmerizing effect.

However, the color-changing animation will last only for a short time due to its default settings. You can also extend the animation duration using the -d flag of lolcat:

Furthermore, if the animation is too fast or too slow for your liking, you can adjust the speed with the -s option:

This command slows down the animation, giving you a more relaxed visual experience.

Create Colorful ASCII Text Banner

Want to create a colorful ASCII text banner in your terminal? Look no further than lolcat. By combining lolcat with the figlet command, you can create a beautiful, rainbow-colored banner that’ll make your terminal stand out.

First, you’ll need to install figlet if it’s not already on your system. You can get figlet using your default package manager, such asapton Ubuntu or Debian-based distro:

On Arch Linux:

Now, you’re able to pipe figlet output with lolcat to display a colorful ASCII text banner with some text:

You can also adjust the fonts used by figlet to create different styles of text. For example, to get the same previous banner with a different font, run this:

Make Things Interesting With cowsay

Want to make things more funny? Let’s combine lolcat withcowsay. This fun command allows you to create speech bubbles with cute animal characters that display a message you provide.

But first, install cowsay from your default package manager if you don’t already have it. To get it on Ubuntu or Debian, type this:

For RHEL or CentOS Linux, run:

Next, combine it with lolcat to get a rainbow-colored cow:

But why stop at cows? Cowsay comes with a whole menagerie of ASCII animals. Let’s see what a rainbow tux has to say:

Tux has never looked so fabulous!

Similar to the lolcat command, the Linux terminal alsooffers a variety of entertaining commandsand tricks to explore when you’re looking to have a bit of fun. Whether you’recustomizing your terminalor just passing the time, there’s always something new to find out.