Lolcat is a fun way to display text in rainbow colors in the Linux terminal. It is a command line utility that takes text input and outputs it in rainbow colors. It is a great way to add a bit of fun and color to your terminal. It is also a great way to make your terminal output stand out from the rest. With Lolcat, you can easily customize the colors and text to make your terminal output look unique and eye-catching.
Lolcat – Display Text in Rainbow Colors in Linux Terminal
To display text in rainbow colors in the Linux terminal, you can use the lolcat command. This command takes text input and prints it out in rainbow colors. To use it, simply type “lolcat” followed by the text you want to display. For example, to display the phrase “Hello World” in rainbow colors, you would type:
lolcat Hello World
For those who believe that Linux Command Line is boring and there isn’t any fun, then you’re wrong here are the articles on Linux, that shows how funny and naughty is Linux.
Here in this article, I will be discussing a small utility called “lolcat” – Which produces a rainbow of colors in the terminal.
Lolcat is a command-line utility for Linux, BSD, and OSX which concatenates similarly to the cat command that is primarily used to display text in rainbow colors in Linux terminal.
It takes the standard input or a file as input and applies rainbow color formatting to the text, making it visually appealing. It can be used for fun or to highlight specific text in terminal output.
Install Lolcat on Linux
To use lolcat, you’ll need to have it installed on your Linux system using your default package manager as shown.
$ sudo apt install lolcat [On Debian, Ubuntu and Mint] $ sudo yum install lolcat [On RHEL/CentOS/Fedora and Rocky/AlmaLinux] $ sudo emerge -a sys-apps/lolcat [On Gentoo Linux] $ sudo apk add lolcat [On Alpine Linux] $ sudo pacman -S lolcat [On Arch Linux] $ sudo zypper install lolcat [On OpenSUSE]
Once you have lolcat installed, you can use it in the terminal by piping text to it or by providing a file as input as shown in the following examples.
lolcat Command Examples
1. To use lolcat, make sure to know the available options and help using the following command.
# lolcat -h
2. Next, piping lolcat with other Linux commands, for example, ps, date, and cal.
# ps | lolcat # date | lolcat # cal | lolcat
3. Use lolcat to display codes of a shell script file called tecmint_monitor.sh as shown:
# lolcat tecmint_monitor.sh
figlet Command Example
4. You can also pipe lolcat with the figlet command, which is a utility that creates ASCII art banners and large letters from ordinary text.
To use figlet, you’ll need to have it installed on your Linux system.
$ sudo apt install figlet [On Debian, Ubuntu and Mint] $ sudo yum install figlet [On RHEL/CentOS/Fedora and Rocky/AlmaLinux] $ sudo emerge -a sys-apps/figlet [On Gentoo Linux] $ sudo apk add figlet [On Alpine Linux] $ sudo pacman -S figlet [On Arch Linux] $ sudo zypper install figlet [On OpenSUSE]
Once you have figlet installed, you can use it with lolcat to make the output text colorful as shown:
# echo I ❤ Tecmint | lolcat # figlet I Love Tecmint | lolcat # figlet I Love Tecmint Linux Blog | lolcat
5. To animate text using lolcat, you can use the option -a for animation and -d for duration i.e. 500.
# echo I ❤ Tecmint Linux Blog | lolcat -a -d 500
cowsay Command Example
6. You can also pipe lolcat with cowsay command that creates ASCII art of a cow (or other animals) with a speech bubble containing a message.
To use cowsay, you must install it on your Linux system.
$ sudo apt install cowsay [On Debian, Ubuntu and Mint] $ sudo yum install cowsay [On RHEL/CentOS/Fedora and Rocky/AlmaLinux] $ sudo emerge -a sys-apps/cowsay [On Gentoo Linux] $ sudo apk add cowsay [On Alpine Linux] $ sudo pacman -S cowsay [On Arch Linux] $ sudo zypper install cowsay [On OpenSUSE]
Once cowsay is installed, you can use it with lolcat as shown.
# cowsay -f tux ☛ Tecmint ☚ is the best Linux Blog | lolcat # cowsay -f turtle ☛ Tecmint ☚ is the best Linux Blog | lolcat
7. You can also use lolcat with any other Linux command in the pipeline and get colored output in the terminal.
For example, you can create an alias for the most frequently used commands to get command output in a rainbow of colors. You can alias the ls -l command which is used for a long list of the contents of a directory as below.
# alias lolls="ls -l | lolcat" # lolls
You may create an alias for any command as suggested above. To create permanent alias, you have to add the relevant code (above code for ls -l alias) to the ~/.bashrc file and also make sure to log out and log in back for the changes to be taken into effect.
8. The lolcat command provides various command-line options to control the color pattern, speed, and other settings. You can explore the available options and usage details by checking the man page
# man lolcat
That’s all for now. I would like to know if you were aware of Lolcat previously. Did you like the post? Any suggestion and feedback is welcome in the comment section below. Like and share us and help us get spread.
Display Text in Rainbow Colors in Linux Terminal
Lolcats love rainbows! And now you can show off your colorful side in the Linux terminal with this fun trick. With a few simple commands, you can make your text appear in a rainbow of colors. Here’s how to do it:
Step 1: Install the Necessary Packages
First, you’ll need to install the
lolcat package. This is a command-line utility that allows you to display text in rainbow colors. To install it, open up a terminal window and type:
sudo apt-get install lolcat
Step 2: Use the lolcat Command
Once the package is installed, you can use the
lolcat command to display text in rainbow colors. To do this, type the following command in the terminal window:
echo "Your text here" | lolcat
Replace “Your text here” with the text you want to display in rainbow colors. For example, if you want to display the phrase “Lolcats love rainbows!”, type the following command:
echo "Lolcats love rainbows!" | lolcat
When you press Enter, the phrase will appear in a rainbow of colors in the terminal window.
That’s all there is to it! With just a few simple commands, you can make your text appear in a rainbow of colors in the Linux terminal. So go ahead and show off your colorful side with this fun trick.