BreakingExpress

Use the Linux cowsay command for a colourful vacation greeting

You might have heard of a small program that takes enter, akin to a message that you just kind, and outputs an image of a cow quoting your message. It is named cowsay. It has been written about earlier than right here on Opensource.com.

So, to have a bit enjoyable with it, I assumed I’d use it to have fun Día de los Muertos (Day of the Dead).

In addition to a cow, there are different photographs obtainable. When you put in cowsay it contains a number of different photographs, which the set up shops in /person/share/cowsay. You can use the -l argument to get a listing.

$ sudo dnf set up cowsay
$ cowsay -l

There’s truly fairly a little bit of improvement exercise associated to cowsay and comparable packages. It is feasible to create your individual picture information or obtain photographs others have made. For occasion, Charc0al’s cowsay file converter is positioned on GitHub. You can use this device to transform your individual footage to the particular ASCII format file required by cowsay. Depending in your Linux or FreeBSD terminal settings, you will have shade assist enabled. The cowsay utility can show shade photographs, as nicely. Charc0al’s converter offers many ready-to-go shade information.

I selected to make use of the Beetlejuice file for my celebration. First, I saved the beetlejuice.cow file to /usr/share/cowsay. This listing is owned by root, so you will have to save lots of the file to your own home listing first after which copy it. I additionally wanted to present all customers learn entry.

$ sudo cp beetlejuice.cow /usr/share/cowsay
$ sudo chmod o+r /usr/share/cowsay/beetlejuice.cow

It is fascinating to note how the picture is generated. The high units numerous ASCII shade management codes to variables. These variables are then used to attract the picture within the conventional ASCII artwork fashion. The picture is sort of full-body and didn’t match my terminal top with out scrolling off the display, so I edited the file and eliminated the final 15 strains to shorten it.

The picture can be detected by the cowsay program and seems within the checklist.

$ cowsay -l
Cow information in /usr/share/cowsay:
beavis.zen beetlejuice blowfish bud-frogs bunny cheese cower default dragon
...

Now, merely run this system and specify the picture utilizing the -f choice. Don’t neglect to supply a message.

$ cowsay -f beetlejuice "Happy Day of the Dead!"

The cowsay command is simply one other technique to have some command-line enjoyable together with your Linux laptop. Experiment with cowsay and ASCII artwork—get artistic.

Exit mobile version