Add rainbow colors to linux command output too slow motion

by time news

2023-04-27 09:00:02

In this article, we’ll review a cool and simple way to give the output of a command screen the colors of the rainbow and slow down its output speed as well for one reason or another.

The lolcat program is used for the above purpose. It basically works by concatenating files, or stdin, to stdout in a similar way to the cat command, it overrides the default screen output color of a particular command and adds rainbow colors to it.

How to install the Lolcat program on Linux

The Lolcat program it is available on almost all modern Linux distributions from its default repository, but the available version is a bit older. Alternatively, you can install the latest version of lolcat from the git repository using the following guide.

To see colors on the console: Review these articles:

  1. Install Lolcat to Generate Rainbow Of Colors in Linux Terminal

Once lolcat is installed, the basic syntax for running lolcat es:

$ lolcat [opciones] [archivos] ...

It comes with several options that control its behavior, below are some of the most important flags that we will emphasize for the scope of this guide:

  1. -a – passes each line of input through an animation effect.
  2. -d – specifies the duration (number of steps before displaying the next line) of the animation effect, the default is 12.
  3. -s – specifies the speed (frame rate, number of steps per second) of the animation effect, the default is 20.
  4. -f – allows to force coloring in case the standard output is not a tty.

You can find more options in the man page lolcat :

$ man lolcat 

How to use Lolcat on Linux

To use lolcat just pipe the output of any relevant command and watch the magic.

For example (you will be surprised):

$ls -l | lolcat -como 25

Also you can alter the default speed, in the following command, we will use a relatively slow speed of 10 steps per second:

$ls -l | lolcat -as 10

You can use any command with screen output lolcat colorfully in the linux terminal some commands say ps, date and cal like:

You can use lolcat, for any output, for example:

cat LICENSE.txt | lolcat

Haz otras pruebas como:
$ ps | lolcat
$ date | lolcat
$ cal | lolcat

En este artículo, hemos visto cómo reducir significativamente la velocidad de salida de una pantalla
de comando y darle un efecto de color de arcoíris.

As usual, you can send us any questions or comments regarding this article through the comments section below. Lastly, you can tell us about any useful Linux commands you have discovered there.

#Add #rainbow #colors #linux #command #output #slow #motion

You may also like

Leave a Comment