In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article will explain in detail how to use the lolcat command in the Linux terminal. The editor thinks it is very practical, so I share it for you as a reference. I hope you can get something after reading this article.
In this article, I'll discuss a gadget called "lolcat" that generates rainbow colors in terminals.
The Lolcat command that generates rainbow-colored output for the terminal
What is lolcat?
Lolcat is a tool for Linux,BSD and OSX platforms that is similar to the cat command and adds rainbow colors to the output of cat. Lolcat is mainly used to add rainbow colors to text in Linux terminals.
Install Lolcat in Linux
1. Lolcat tools are available in the software repositories of many Linux distributions, but the available versions are a bit outdated, and you can download and install the latest version of lolcat through the git repository.
Since Lolcat is a ruby gem program, you must have the latest version of RUBY installed on your system.
# apt-get install ruby [in APT-based systems] # yum install ruby [in Yum-based systems] # dnf install ruby [in DNF-based systems]
Once the ruby package is installed successfully, be sure to verify the version of the installed ruby.
# ruby-version ruby 2.1.5p273 (2014-11-13) [x86_64-linux-gnu]
two。 Then use the following command to download and install the latest version of lolcat from lolcat's git repository.
# wget https://github.com/busyloop/lolcat/archive/master.zip# unzip master.zip# cd lolcat-master/bin# gem install lolcat
Once lolcat is installed, you can check its version number.
# lolcat-usage of version lolcat 42.0.99 (c) 2011 moe@busyloop.netLolcat
3. Before you start using lolcat, use the following command to learn about its available options and its help documentation.
# lolcat-h
Help documentation for Lolcat
4. Next, pipe lolcat to other commands, such as ps, date, and cal:
# ps | lolcat# date | lolcat# cal | lolcat
Output of the ps command
Output of Date
Output of Calendar
5. Use lolcat to show the code of a script file:
# lolcat test.sh
Using lolcat to show the code
6. Connect the lolcat and figlet commands through pipes. Figlet is an application that shows huge strings of regular screen characters. We can pipe the output of figlet to lolcat to show the following colorful output:
# echo I ❤ Tecmint | lolcat# figlet I Love Tecmint | lolcat
Colorful words
Note: note that ❤ is a unicode character. To install figlet, you need to use yum and apt to get the package as follows:
# apt-get figlet # yum install figlet # dnf install figlet
7. Animation that gives rainbow color to text:
$echo I ❤ Tecmit | lolcat-a-d 500
Moving text
Here the option-a refers to Animation and-d refers to duration (duration). In the above example, it lasted 500 animations.
8. Read man pages (such as man ls) in rainbow colors:
# man ls | lolcat
Colorful display of documents
9. Connect lolcat and cowsay through pipes. Cowsay is a configurable cow that is thinking or talking, and this program also supports other animals.
Use the following command to install cowsay:
# apt-get cowsay# yum install cowsay# dnf install cowsay
After installation, use the following command to display all animals in cowsay:
# cowsay-l
Sample output
Cow files in / usr/share/cowsay/cows:apt beavis.zen bong bud-frogs bunny calvin cheese cock cower daemon defaultdragon dragon-and-cow duck elephant elephant-in-snake eyes flaming-sheepghostbusters gnu head-in hellokitty kiss kitty koala kosh luke-koalamech-and-cow meow milk moofasa moose mutilated pony pony-smaller ren sheepskeleton snowman sodomized-sheep stegosaurus stimpy suse three-eyes turkeyturtle tux unipony unipony-smaller vader vader-koala www
The output after connecting lolcat and cowsay through a pipe, and uses the cowfile of the 'gnu' image.
# cowsay-f gnu ☛ Tecmint ☚ is the best Linux Resource Available online | lolcat
Cowsay using Lolcat
Note: you can get color output in the terminal by piping lolcat with any other command.
10. You can create aliases for the most commonly used commands to make the output of the command rainbow-like. You can create an alias for the'ls-l 'command as below, which outputs a list of contents in the directory.
# alias lolls= "ls-l | lolcat" # lolls
This is the end of this article on "how to use lolcat commands in Linux terminals". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.