Get the App
SLTechnology News&Howtos  ›  Servers  › 

How to output the result of Linux command in slow motion and display it in color

Shulou Source: shulou.com Published: 2022-06-01 05:29:43 11月12日 Update

Editor to share with you how to slow-motion output Linux command results and color display, I believe that most people do not understand, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!

The lolcat command meets the above requirements. It basically directs files or standard input to standard output to run in a manner similar to the cat command, overriding the default screen output color of a command and adding color to it.

How to install lolcat programs in Linux

Lolcat is available in the default repository of most modern Linux distributions, but the available versions are a bit old. You can use the instructions below to install the lolcat version of * * from the git repository.

Install lolcat to display color output in Linux

After lolcat is installed, the basic lolcat syntax is:

$lolcat [options] [files]...

There are several options to control its behavior, and here are some of the most important signs we will highlight in this guide:

-a-displays a dynamic effect on each line of output.

-d-specifies the animation interval (frames before the next line is displayed), which defaults to 12.

-s-it specifies the speed of the animation (frame rate-the number of frames per second displayed), which defaults to 20.

-f-Force color display to prevent standard output from being tty.

You can find more options on the man page of lolcat:

$man lolcat

How to use lolcat in Linux

To use lolcat, you can witness magic by piping the output of related commands directly to lolcat.

For example:

$ls-l | lolcat-as 25

Colorful Linux Terminal Output

In addition, you can also change the default speed. In the following command, we will use a relatively slow speed of 10 frames per second:

$ls-l | lolcat-as 10

You can use any command in combination with lolcat to output color results in Linux terminals, such as ps, date, and cal:

$ps | lolcat $date | lolcat $cal | the above is "how to output the result of Linux command in slow motion and display it in color". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Tags: Output command color result effect standard article speed face slow motion warehouse content animation more version Zhongan guide important one line not so much Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Redmi Xiaomi Linux Shulou Technology Huawei