TranslateProject/sources/tech/20220706 10 Tools to Generate and Have Fun With ASCII Art in Linux Terminal.md

9.6 KiB
Raw Blame History

10 Tools to Generate and Have Fun With ASCII Art in Linux Terminal

Linux terminal is not as scary as you think.

Of course, it could be intimidating in the beginning but once you know the terminal better, you start loving it.

You are likely to use the terminal for serious work. But there are many fun stuff you can do in the terminal as well.

One of them is experimenting with ASCII art. You can display predefined or random messages, play games, or run some animation in ASCII format in the Linux terminal using various command line tools.

My teammate Sreenath likes to explore such unusual CLI tools and share his findings with me. I am sharing those findings with you.

ascii art tools linux

Most of these programs should be available in the repositories of your Linux distribution. You can use your systems package manager to install them. To keep the article concise, I have only included the installation instructions for Ubuntu.

1. lolcat: Add colors to your terminal

Alright! lolcat doesnt have anything to do with ASCII art. At least not directly.

Still, I included it at the beginning of this article because you can combine other ASCII tools with lolcat.

So, what does it do? It is similar to the cat command but it adds random gradient colors to its output.

lolcat

It may not look useful at the moment but youll see its impact when the outputs of other ASCII tools are piped through lolcat.

Install lolcat with the apt command:

sudo apt install lolcat

2. Aewan: Display ASCII text beautifully

Aewan is a multi-layered ASCII graphics/animation editor. It produces stand-alone cat-able ASCII art files and an easy-to-parse format for integration into terminal applications.

It has two tools: aewan, an ASCII editor and aecat, for viewing the created file.

I am not going to discuss the editor part here.

aewan initial layout

To display any text in pretty ASCII format, you need the aecat command. Notice the use of letters in the screenshot below.

aewan output

To install aewan use the following command:

sudo apt install aewan

And then use it like this:

aecat hello

3. Cowsay: Make an ASCII cow say whatever you want

What does the cow say? Whatever you want it to say.

The cowsay is already a popular tool among seasoned Linux users. It shows an ASCII cow that repeats the text you provide it.

cowsay

But you are not restricted to cows only. You can change it to several other characters as well. Like a dragon (burning Kings landing):

cowsay

Did you notice the colored output in the above screenshot? Thats the magic of the lolcat command I mentioned earlier.

To install cowsay, use:

sudo apt install cowsay

Once installed, you can use it like this:

cowsay hello

You can refer to its man page for additional configuration and options.

4. jp2a: Convert images into ASCII art

jp2a is a command-line tool that converts images to ASCII art in the Linux terminal. It works with JPEG and PNG files. It also allows colored output and your selection of character set to appear as ASCII image.

jp2a

You can install it using the following command:

sudo apt install jp2a

You can get the colorful output and save the ASCII text like this:

jp2a --output=ascii.txt --colors input.png

Its not the only program of this kind. There is ascii-image-converter and several other tools that could be used for the same purpose. I wont discuss all of them in this list.

5. linuxlogo: Display the ASCII logo your Linux distro

The name says it all. It displays the Linux logo in ASCII format.

No, not our beloved Linux logo, Tux but the logo of your Linux distribution. It also shows a few additional information like Linux kernel version, CPU, RAM, hostname, etc.

linux logo

You can install it using the apt command:

sudo apt install linuxlogo

Just enter linuxlogo to use the command.

6. Neoftech: Display the Linux logo along with system info

The above linuxlogo command is too simplistic. You can amp it up by using Neofetch.

It displays the distribution in a more pretty way along with several system information like kernel, uptime, desktop environment, theme, icons, etc.

neofetch

You can also parse it through lolcat to get rainbow-colored output.

Install Neoftech using this command:

sudo apt install neofetch

And then just enter neoftech to run the command.

There is also screenfetch, a similar tool to Neofetch. You can use either of them.

7. fortune: Get your fortune told

Just kidding! Theres no such thing.

However, fortune cookies are still fashionable and apparently, people like to read random predictions or teachings.

You can get a similar feature in the Linux terminal with the fortune command:

fortune cookie linux

You can install it using the following command:

sudo apt install fortune

Once installed, just enter fortune in the terminal to get a random message.

8. pv: Make things animated

This is a classic example of the unintended use of a Linux command. The pv command is used to monitor the progress of data through pipe.

But you can use it to animate the output of any command. Combine it with some of the above-mentioned commands and you can see the ASCII art appearing on your screen as if it is being typed.

Dont get it? Watch this video:

A Video from YouTube

Install it using the following command:

sudo apt install pv

And then use it in the following manner:

neofetch | pv -qL 200 | lolcat

The higher the number, the higher will be the speed.

9. cmatrix: Matrix like animation in ASCII

Remember the cult geek move Matrix? The green falling code is synonymous with Matrix and hacking.

You can run an ASCII simulation of the falling code in the Linux terminal with cmatrix command.

I am sharing a screenshot instead of animation here.

cmatrix

You can install it with apt command:

sudo apt install cmatrix

Once installed, you can run it with:

cmatrix

It starts the animation immediately and it keeps on generating random green text falling and disappearing from the screen. The command keeps on running. To stop the running application, use the Ctrl+C keys.

10. cbonsai: Grow a bonsai in your terminal

Got a green thumb? How about growing an ASCII bonsai tree in the terminal?

cbonsai is a fun Linux command that lets you run bonsai tree growing animation in ASCII format.

I shared a YouTube Shorts of cbonsai command a few days ago.

Have fun with the Linux terminal 😍 🐧

Subscribe to our YouTube channel for more Linux videos

You can install cbonsai using:

sudo apt install cbonsai

And then to run the animation, use this command:

cbonsai -l

Try some more

There are many more such fun CLI tools. Heck, there are ASCII games as well. Its fun to use them at times to amuse people around you.

Can you put these commands to some good use? Not certain about the usability, but you can add some of them in your .bashrc file so that the command is run as soon as you open a terminal session.

Many sys-admins do that on shared Linux systems. A program like cowsay or figlet can be used to display a message or system info in a pretty way.

You may also use some of these programs in your bash scripts, especially if you have to highlight something.

There could be other usages of ASCII art in Linux. I let you share them with the rest of us here.


via: https://itsfoss.com/ascii-art-linux-terminal/

作者:Abhishek Prakash 选题:lkxed 译者:译者ID 校对:校对者ID

本文由 LCTT 原创编译,Linux中国 荣誉推出