search
HomeSystem TutorialLINUXMake the terminal more lively and interesting - use the Linux cowsay command to complain

Make the terminal more lively and interesting - use the Linux cowsay command to complain

Feb 12, 2024 pm 05:39 PM
linuxlinux tutoriallinux systemlinux commandshell scriptembeddedlinuxGetting started with linuxlinux learning

For most people, using the Linux terminal is a very boring thing. However, have you ever thought about adding some interesting elements to your terminal? Today, we will introduce a command called cowsay, which can make your terminal more interesting and vivid.

Celebrate the holidays with this fun Linux command line tool.

You may have heard of a small program that accepts input information (such as a message you enter via the keyboard) and outputs an image of a cow that references the input message. This little program is called cowsay, and we've introduced it before.

So, in order to do something fun, I wanted to use it to celebrate Día de los Muertos (LCTT translation: the traditional Mexican ghost festival, the famous animated film "Coco" is the setting for this) .

In addition to cows, there are actually some other images available. When cowsay is installed, the program automatically installs several other images and stores them in the /user/share/cowsay directory. You can use the -l parameter to get a list of images.

$ sudo dnf install cowsay
$ cowsay -l

There is actually a lot of development activity related to cowsay or similar programs. You can create your own image files or download images made by others. For example, Charc0al’s cowsay file converter is available on GitHub. You can use this tool to convert your own images into the special ASCII format required by cowsay. Depending on your Linux or FreeBSD terminal setup, you may have color support enabled and cowsay can also display color images. Charc0al's converter also provides many ready-made color files.

I chose the "Beetlejuice" (LCTT translation: the Archmage, the protagonist in the American fantasy comedy film of the same name) file to carry out my "celebration". First, I saved the beetlejuice.cow file to the /usr/share/cowsay directory. The permissions of this directory belong to the root user. You can save the file to your home directory first and then copy it there. In addition, we also need to give read permission to the file to all users.

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

Pay attention to how the image is generated (the process is interesting). First set the various ASCII color control codes as variables, and then use these variables to draw the image in traditional ASCII art style. The resulting image was almost full body and didn't fit the height of my terminal without scrolling the screen, so I edited the file and removed the last 15 lines to lower the height.

This image can also be detected by the cowsay program and displayed in the list.
Make the terminal more lively and interesting - use the Linux cowsay command to complain

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

Now, just run the program and specify the image using the -f option. Don't forget to provide the information to be output.

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

"Beetlejuice" wishes you a Happy Day of the Dead (CC BY-SA 4.0)

cowsay is an interesting and quirky gadget in Linux. Get creative and explore cowsay and the art of ASCII.

Through the introduction of this article, you have mastered the basic usage of the cowsay command, and learned how to use different pictures and text to generate unique complaints. Making the terminal full of fun and no longer boring, this is the charm that cowsay brings to us. Act quickly and make your terminal lively and interesting!

The above is the detailed content of Make the terminal more lively and interesting - use the Linux cowsay command to complain. For more information, please follow other related articles on the PHP Chinese website!

Statement
This article is reproduced at:良许Linux教程网. If there is any infringement, please contact admin@php.cn delete
Top 5 Linux Tools for Monitoring Disk I/O PerformanceTop 5 Linux Tools for Monitoring Disk I/O PerformanceApr 27, 2025 pm 04:45 PM

This guide explores essential Linux tools for monitoring and troubleshooting disk I/O performance, a crucial metric impacting server speed and application responsiveness. Disk I/O performance directly affects how quickly data is read from and written

4 Ways to Find Plugged USB Device Name in Linux4 Ways to Find Plugged USB Device Name in LinuxApr 27, 2025 pm 04:44 PM

For new Linux users, identifying connected devices is crucial, especially USB drives. This guide provides several command-line methods to determine a USB device's name, essential for tasks like formatting. While USB drives often auto-mount (e.g., /

How to Fix 'No Space Left on Device” on Root (/) PartitionHow to Fix 'No Space Left on Device” on Root (/) PartitionApr 27, 2025 pm 04:43 PM

One of the most common problems with Linux systems, especially those with limited disk space, is the exhaustion of root partition (/) space. When this problem occurs, you may encounter the following error: No space left on device Don’t panic! This just means that your root directory (/partition) is full, which is a common problem, especially on systems with limited disk space or servers running 24/7. When this happens, you may encounter the following problems: The package cannot be installed or upgraded. System startup failed. The service cannot be started. Unable to write to logs or temporary files. This article walks you through practical steps to identify problems, clean up space safely, and prevent them from happening again. These instructions are suitable for beginners

Top 16 Notepad   Replacements for Linux in 2025Top 16 Notepad Replacements for Linux in 2025Apr 27, 2025 pm 04:42 PM

This article explores top-notch Notepad alternatives for Linux users. Notepad , while excellent on Windows, lacks a Linux version. This guide offers a diverse range of options to suit various needs and preferences. Top Notepad Alternatives for

How to Create and Run New Service Units in SystemdHow to Create and Run New Service Units in SystemdApr 27, 2025 pm 04:41 PM

Several days ago, I encountered a 32-bit CentOS 8 distribution and decided to test it on an older 32-bit system. Post-boot, I discovered a network connectivity issue; the connection would drop, requiring manual restoration after each reboot. This pr

How to Check for Bad Sectors on a Hard Disk in LinuxHow to Check for Bad Sectors on a Hard Disk in LinuxApr 27, 2025 pm 04:40 PM

Let's clarify what constitutes a bad sector or bad block: it's a portion of a hard drive or flash memory that's become unreadable or unwritable, typically due to physical damage to the disk surface or malfunctioning flash memory transistors. Accumul

How to Force cp Command to Overwrite Files Without PromptHow to Force cp Command to Overwrite Files Without PromptApr 27, 2025 pm 04:39 PM

The cp command, short for "copy," is a fundamental tool in Linux and other Unix-like systems for duplicating files and directories. While efficient for local file transfers, for network-based copies, scp (secure copy) is preferred due to i

Fix 'rm: Cannot Remove File – Device or Resource Busy” ErrorFix 'rm: Cannot Remove File – Device or Resource Busy” ErrorApr 27, 2025 pm 04:38 PM

When using the rm command to delete a file or directory in Linux system, if you encounter the following error: rm: cannot remove 'file-or-directory': Device or resource busy Don't worry, this is a common problem, which means that the file or directory you are trying to delete is currently being used by the system or running process. Cause of error The "Device or Resource Busy" message indicates that the file or directory is in use. To avoid damaging the system or causing data loss, Linux prevents deleting files in use. Common reasons include: Your terminal is currently in the directory you want to delete. The program or process is using the file or directory.

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Atom editor mac version download

Atom editor mac version download

The most popular open source editor

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

DVWA

DVWA

Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software