Linux has a rich collection of commands, and while many of them are powerful and useful for various tasks, there are also some funny and whimsical commands that you can try out for amusement.
1. sl Command (Steam Locomotive)
You might be aware of the command ls command, which is used frequently to view the contents of a directory but because of miss-typing sometimes you would result in ‘sl‘.
The sl command is to playfully simulate a train moving across your terminal when you accidentally type “sl” instead of “ls” (a common mistype).
Install sl Command
$ sudo apt install sl [On <strong>Debian, Ubuntu and Mint</strong>] $ sudo yum install sl [On <strong>RHEL/CentOS/Fedora</strong> and <strong>Rocky/AlmaLinux</strong>] $ sudo emerge -a sys-apps/sl [On <strong>Gentoo Linux</strong>] $ sudo apk add sl [On <strong>Alpine Linux</strong>] $ sudo pacman -S sl [On <strong>Arch Linux</strong>] $ sudo zypper install sl [On <strong>OpenSUSE</strong>]
After installation, you can try running the sl command by simply typing.
$ sl
2. telehack Command
The telehack is a website that provides a text-based interface resembling a command-line environment, where you can interact with various commands, explore simulated systems, play text-based games, read articles, and even participate in a simulated storyline.
Go to the telehack website, and type the following command.
$ starwars
3. fortune Command
The fortune command is a fun command that is used to display a random quote, a witty saying, or a fortune message.
Install fortune Command
$ sudo apt install fortune [On <strong>Debian, Ubuntu and Mint</strong>] $ sudo yum install fortune [On <strong>RHEL/CentOS/Fedora</strong> and <strong>Rocky/AlmaLinux</strong>] $ sudo emerge -a sys-apps/fortune [On <strong>Gentoo Linux</strong>] $ sudo apk add fortune [On <strong>Alpine Linux</strong>] $ sudo pacman -S fortune [On <strong>Arch Linux</strong>] $ sudo zypper install fortune [On <strong>OpenSUSE</strong>]
After installation, you can try running the fortune command by simply typing.
$ fortune
4. rev Command
The rev command is used to reverse the order of characters in each line of a given input. It reads the input from either standard input or from files and outputs the reversed lines.
To reverse the characters in a file, use the following command.
$ rev tecmint.txt
5. factor Command
The factor command is used to factorize a given integer into its prime factors. It calculates the prime factors of the specified number and displays them on the standard output.
$ factor 5
6. Nested Loop in Bash
This is not a command, but a nested loop in Bash that prints a multiplication table from 1 to 12. It uses two variables, i and j, to iterate through the numbers and calculates their product.
$ for i in {1..12}; do for j in $(seq 1 $i); do echo -ne $i?—$j=$((i*j))\\t;done; echo;done
Here is an explanation of the command:
for i in {1..12}; do # Outer loop iterating from 1 to 12 for j in $(seq 1 $i); do # Inner loop iterating from 1 to the current outer loop value echo -ne "$i×$j=$((i*j))\t"; # Print the multiplication expression and result done echo; # Move to the next line after each inner loop done
When you run this command in the terminal, it will generate the following output.
7. cowsay Command
The cowsay command is used to generate an ASCII art representation of a cow or other animals with speech or thought bubbles containing a customizable message.
Install cowsay Command
$ sudo apt install cowsay [On <strong>Debian, Ubuntu and Mint</strong>] $ sudo yum install cowsay [On <strong>RHEL/CentOS/Fedora</strong> and <strong>Rocky/AlmaLinux</strong>] $ sudo emerge -a sys-apps/cowsay [On <strong>Gentoo Linux</strong>] $ sudo apk add cowsay [On <strong>Alpine Linux</strong>] $ sudo pacman -S cowsay [On <strong>Arch Linux</strong>] $ sudo zypper install cowsay [On <strong>OpenSUSE</strong>]
After installation, you can try running the cowsay command by simply typing.
$ cowsay I Love Tecmint.com $ cowsay I Love Linux
To combine the fortune with the cowsay command to display a random fortune message using a pipe (|) to pass the output of one command to be the input of another command.
In the below example, the output of the ‘fortune‘ command acts as an input of the ‘cowsay‘ command.
$ fortune | cowsay
xcowsay is a graphical program that response similar to cowsay but in a graphical manner, that generates an animated speech bubble with a customizable message, usually featuring a cow or other characters, on the desktop.
Install xcowsay Command
$ sudo apt install xcowsay [On <strong>Debian, Ubuntu and Mint</strong>] $ sudo yum install xcowsay [On <strong>RHEL/CentOS/Fedora</strong> and <strong>Rocky/AlmaLinux</strong>] $ sudo emerge -a sys-apps/xcowsay [On <strong>Gentoo Linux</strong>] $ sudo apk add xcowsay [On <strong>Alpine Linux</strong>] $ sudo pacman -S xcowsay [On <strong>Arch Linux</strong>] $ sudo zypper install xcowsay [On <strong>OpenSUSE</strong>]
Once xcowsay is installed, you can launch it by running:
$ xcowsay I Love Tecmint.com
8. yes Command
The yes command prints a continuous stream of the specified string or text repeatedly until terminated, which is often used in scripts or command-line operations that require automated or repeated input of a specific value.
$ yes I Love Tecmint.com
9. toilet Command
The toilet command generates visually appealing ASCII art text-based banners or large letters using various fonts in the terminal.
Install toilet Command
$ sudo apt install toilet [On <strong>Debian, Ubuntu and Mint</strong>] $ sudo yum install toilet [On <strong>RHEL/CentOS/Fedora</strong> and <strong>Rocky/AlmaLinux</strong>] $ sudo emerge -a sys-apps/toilet [On <strong>Gentoo Linux</strong>] $ sudo apk add toilet [On <strong>Alpine Linux</strong>] $ sudo pacman -S toilet [On <strong>Arch Linux</strong>] $ sudo zypper install toilet [On <strong>OpenSUSE</strong>]
Once the toilet is installed, you run the command with the text you want to convert into an ASCII banner.
$ toilet TecMint.com
If you want to print the banner in a large font, you can run:
$ toilet -f big TecMint.com
10. cmatrix Command
You might have seen the Hollywood movie ‘Matrix‘ and would be fascinated with the power, Neo was provided with, to see anything and everything in the Matrix or you might think of an animation that looks like Matrix’s?desktop.
Then you should use a cmatrix command that displays an animated matrix-like rain of text characters on your terminal, similar to the “Matrix” movie.
Install cmatrix Command
$ sudo apt install cmatrix [On <strong>Debian, Ubuntu and Mint</strong>] $ sudo yum install cmatrix [On <strong>RHEL/CentOS/Fedora</strong> and <strong>Rocky/AlmaLinux</strong>] $ sudo emerge -a sys-apps/cmatrix [On <strong>Gentoo Linux</strong>] $ sudo apk add cmatrix [On <strong>Alpine Linux</strong>] $ sudo pacman -S cmatrix [On <strong>Arch Linux</strong>] $ sudo zypper install cmatrix [On <strong>OpenSUSE</strong>]
Once cmatrix is installed, you can run the command that displays a full of cascading green characters resembling the falling code from the “Matrix” movie.
$ cmatrix
11. oneko Command
OK, so you believe that the mouse pointer of Linux is the same silly black/white pointer where no animation lies then I fear you could be wrong.
The “oneko” is a package that will attach a “Jerry” with your mouse pointer and moves along with your pointer.
Install oneko Command
$ sudo apt install oneko [On <strong>Debian, Ubuntu and Mint</strong>] $ sudo yum install oneko [On <strong>RHEL/CentOS/Fedora</strong> and <strong>Rocky/AlmaLinux</strong>] $ sudo emerge -a sys-apps/oneko [On <strong>Gentoo Linux</strong>] $ sudo apk add oneko [On <strong>Alpine Linux</strong>] $ sudo pacman -S oneko [On <strong>Arch Linux</strong>] $ sudo zypper install oneko [On <strong>OpenSUSE</strong>]
Once oneko is installed, you run the command to see a small animated cat on your screen.
$ oneko
Once you close the terminal from which oneko was run, Jerry will disappear, nor will start at start-up. You can add the application to start up and continue enjoying.
12. Fork Bomb
A fork bomb is a type of malicious code or command that can cause a denial-of-service (DoS) condition by rapidly and exponentially creating child processes, which exploits the “fork” system call in the operating system.
It can also cause severe disruption, loss of data, or damage to the system, which might make you unresponsive, and you might need to reboot the machine to regain control.
To check the power of the fork command you should try it once, but all at your own risk, close and save all other programs and files before running a fork bomb.
$ :(){ :|: & };:
Let’s break down how this fork bomb works:
-
:(){ ... }
– This defines a function named":"
(colon) without any arguments. -
:|:
– This calls the function recursively by piping its output to another instance of the function. -
&
– This puts the command in the background, allowing it to run concurrently. -
;:
– This executes the function again after the initial invocation, causing it to continue indefinitely.
13. while Command
The following while command is a bash script that provides you with a colored date and time in a stylized ASCII art format using the toilet. It uses a while loop to repeatedly execute the commands and includes a 1-second delay between each iteration.
$ while true; do echo "$(date ' %D %T' | toilet -f term -F border --gay)"; sleep 1; done
Here’s an explanation of the command:
while true; do # Start an infinite loop echo "$(date ' %D %T' | toilet -f term -F border --gay)"; # Print the formatted date and time using toilet sleep 1; # Delay for 1 second done
The above script when modified with the following command, will give similar output but with a little difference, check it in your terminal.
$ while true; do clear; echo "$(date ' %D %T' | toilet -f term -F border --gay)"; sleep 1; done
14. espeak Command
The espeak is a text-to-speech (TTS) synthesis command that converts text input into spoken words in various languages and voices.
Install espeak Command
$ sudo apt install espeak [On <strong>Debian, Ubuntu and Mint</strong>] $ sudo yum install espeak [On <strong>RHEL/CentOS/Fedora</strong> and <strong>Rocky/AlmaLinux</strong>] $ sudo emerge -a sys-apps/espeak [On <strong>Gentoo Linux</strong>] $ sudo apk add espeak [On <strong>Alpine Linux</strong>] $ sudo pacman -S espeak [On <strong>Arch Linux</strong>] $ sudo zypper install espeak [On <strong>OpenSUSE</strong>]
Once espeak is installed, you run the command with the text you want to be spoken.
$ espeak "I Love TecMint.com"
15. aafire Command
The aafire is a fun command that displays visually appealing ASCII art animation of a fire effect in the terminal using ASCII characters.
Install aafire Command
$ sudo apt install libaa-bin [On <strong>Debian, Ubuntu and Mint</strong>] $ sudo yum install aalib [On <strong>RHEL/CentOS/Fedora</strong> and <strong>Rocky/AlmaLinux</strong>] $ sudo emerge -a sys-apps/aalib [On <strong>Gentoo Linux</strong>] $ sudo apk add aalib [On <strong>Alpine Linux</strong>] $ sudo pacman -S aalib [On <strong>Arch Linux</strong>] $ sudo zypper install aalib [On <strong>OpenSUSE</strong>]
Once aafire is installed, you run the command to see a fire animation in your terminal.
$ aafire
16. bb Command
The bb is a simple command-line ASCII art demo that displays an animated ASCII art representation of a bouncing ball on the terminal screen.
Install bb Command
$ sudo apt install bb [On <strong>Debian, Ubuntu and Mint</strong>] $ sudo yum install bb [On <strong>RHEL/CentOS/Fedora</strong> and <strong>Rocky/AlmaLinux</strong>] $ sudo emerge -a sys-apps/bb [On <strong>Gentoo Linux</strong>] $ sudo apk add bb [On <strong>Alpine Linux</strong>] $ sudo pacman -S bb [On <strong>Arch Linux</strong>] $ sudo zypper install bb [On <strong>OpenSUSE</strong>]
Once bb is installed, you run the command to see a visual effect of a ball bouncing around the terminal screen.
$ bb
17. curl Command
Won’t it be an awesome feeling for you if you can update your Twitter status from the command line in front of your friend and they seem impressed?.
To post a status to Twitter using the curl command, you need to use the Twitter API’s POST endpoint for creating a tweet as shown.
$ curl -X POST -u "YourBearerToken:" -d "status=Your status message" "https://api.twitter.com/1.1/statuses/update.json"
18. ASCIIquarium
ASCIIquarium is an entertaining perl script that displays an animated aquarium in ASCII art format directly in your Linux terminal. It creates a simulation of underwater life with fish, plants, and other elements.
On Ubuntu or Debian-based systems, you can install ASCIIquarium with the following commands.
First, you need to install the Term::Animation module as shown.
$ sudo apt install libcurses-perl $ sudo apt install libcurses-perl $ wget https://cpan.metacpan.org/authors/id/K/KB/KBAUCOM/Term-Animation-2.5.tar.gz $ tar xzf Term-Animation-2.5.tar.gz $ cd Term-Animation-2.5/ $ perl Makefile.PL $ make $ sudo make install
Next, install ASCIIquarium with the following commands.
$ cd /tmp $ wget http://www.robobunny.com/projects/asciiquarium/asciiquarium.tar.gz $ tar -zxvf asciiquarium.tar.gz $ cd asciiquarium_1.1/ $ sudo cp asciiquarium /usr/local/bin $ sudo chmod 0755 /usr/local/bin/asciiquarium
Finally, run “asciiquarium” or “/usr/local/bin/asciiquarium” in the terminal without quotes and be a part of the magic that will be taking place in front of your eyes.
$ asciiquarium
19. Funny Linux Man Pages
Funny man pages, also known as “man pages with attitude,” are entertaining versions of the traditional Linux man pages, as they don’t offer abt serious or practical information, they are meant to bring a smile to your face.
Install Funny Man Pages
$ sudo apt install funny-manpages [On <strong>Debian, Ubuntu and Mint</strong>] $ sudo yum install funny-manpages [On <strong>RHEL/CentOS/Fedora</strong> and <strong>Rocky/AlmaLinux</strong>] $ sudo emerge -a sys-apps/funny-manpages [On <strong>Gentoo Linux</strong>] $ sudo apk add funny-manpages [On <strong>Alpine Linux</strong>] $ sudo pacman -S funny-manpages [On <strong>Arch Linux</strong>] $ sudo zypper install funny-manpages [On <strong>OpenSUSE</strong>]
Once funny-manpages is installed, you can have access to the funny-man pages of the command you want to view.
$ man baby $ man celibacy $ man condom $ man date $ man echo $ man flame $ man flog $ man gong
20. pv Command
You might have seen the simulating text in movies, which appears as if it is being typed in real-time. Won’t it be nice, if you can have such an effect in your terminal?
This can be achieved, by installing the pv command (pipe viewer), which is used to monitor the progress of data through a pipeline.
Install pv Command
$ sudo apt install pv [On <strong>Debian, Ubuntu and Mint</strong>] $ sudo yum install pv [On <strong>RHEL/CentOS/Fedora</strong> and <strong>Rocky/AlmaLinux</strong>] $ sudo emerge -a sys-apps/pv [On <strong>Gentoo Linux</strong>] $ sudo apk add pv [On <strong>Alpine Linux</strong>] $ sudo pacman -S pv [On <strong>Arch Linux</strong>] $ sudo zypper install pv [On <strong>OpenSUSE</strong>]
Once, the pv command is installed successfully on your system, let’s try to run the following one-liner command to see the real-time text effect on the screen.
$ echo "Tecmint[dot]com is a community of Linux Nerds and Geeks" | pv -qL 10
The q
option means ‘quiet‘, no output information, and option L
means the limit of transfer of bytes per second. The number value can be adjusted in either direction (must be an integer) to get the desired simulation of text.
21. rig Command
The rig short for “Random Identity Generator” is a command that is used to generate random fake identities for testing, simulation, or other purposes.
Install rig Command
$ sudo apt install rig [On <strong>Debian, Ubuntu and Mint</strong>] $ sudo yum install rig [On <strong>RHEL/CentOS/Fedora</strong> and <strong>Rocky/AlmaLinux</strong>] $ sudo emerge -a sys-apps/rig [On <strong>Gentoo Linux</strong>] $ sudo apk add rig [On <strong>Alpine Linux</strong>] $ sudo pacman -S rig [On <strong>Arch Linux</strong>] $ sudo zypper install rig [On <strong>OpenSUSE</strong>]
Once installed, you can use the rig command to generate random identities.
$ rig
22. aview Command
The aview command converts images into ASCII art and displays them in the terminal. To use the aview command, you need to have it installed on your system.
$ sudo apt install aview [On <strong>Debian, Ubuntu and Mint</strong>] $ sudo yum install aview [On <strong>RHEL/CentOS/Fedora</strong> and <strong>Rocky/AlmaLinux</strong>] $ sudo emerge -a sys-apps/aview [On <strong>Gentoo Linux</strong>] $ sudo apk add aview [On <strong>Alpine Linux</strong>] $ sudo pacman -S aview [On <strong>Arch Linux</strong>] $ sudo zypper install aview [On <strong>OpenSUSE</strong>]
I’ve got an image named ‘actress.jpg‘ (guess the actress) in my current working directory and I want to view it on the terminal in ASCII format.
$ aview actress.jpg
23. xeyes Command
Earlier, we introduced a command ‘oneko‘ which attaches Jerry with a mouse pointer and keeps on chasing it. A similar program ‘xeyes‘ is a graphical program and as soon as you fire the command you will see two monster eyes chasing your movement.
$ sudo apt install x11-apps [On <strong>Debian, Ubuntu and Mint</strong>] $ sudo yum install xeyes [On <strong>RHEL/CentOS/Fedora</strong> and <strong>Rocky/AlmaLinux</strong>] $ sudo emerge -a sys-apps/xeyes [On <strong>Gentoo Linux</strong>] $ sudo apk add xeyes [On <strong>Alpine Linux</strong>] $ sudo pacman -S xeyes [On <strong>Arch Linux</strong>] $ sudo zypper install xeyes [On <strong>OpenSUSE</strong>]
Once installed, run:
$ xeyes
24. Linux Tweaks
It is time for you to have some one-liner Linux tweaks to have some fun in the terminal.
$ world <strong>bash: world: not found</strong>
$ touch girls\ boo** <strong>touch: cannot touch `girls boo**': Permission denied</strong>
$ nice man woman <strong>No manual entry for woman</strong>
$ ^How did the sex change operation go?^ <strong>bash: :s^How did the sex change operation go?^ : substitution failed</strong>
$ %blow <strong>bash: fg: %blow: no such job</strong>
$ make love <strong>make: *** No rule to make target `love'. Stop</strong>.
$ [ whereis my brain? <strong>sh: 2: [: missing ]</strong>
$ % man: why did you get a divorce? <strong>man:: Too many arguments</strong>.
$ % !:say, what is saccharine? <strong>Bad substitute</strong>.
$ \(- <strong>bash: (-: command not found</strong>
Linux is naughty – if you know what I mean…:)
$ who | grep -i blonde | date; cd ~; unzip; touch; strip; finger; mount; gasp; yes; uptime; umount; sleep
There are certain others but these don’t work on all the systems and hence not included in this article. Some of them are man dog, filter, banner, etc.
Have fun, you can say me thanks later :) yup, your comment is highly appreciated which encourages us to write more. Tell us which command you liked the most. Stay tuned I will be back soon with another article worth reading.
The above is the detailed content of 24 Hilarious Linux Commands That Will Make You Laugh. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undress AI Tool
Undress images for free

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Clothoff.io
AI clothes remover

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

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

While writing program files or normal text files, programmers and writers sometimes want to know the difference between two files or two versions of the same file. When you compare two computer files on Linux, the difference between their contents is

There are three ways to create empty files in the command line: First, the simplest and safest use of the touch command, which is suitable for debugging scripts or placeholder files; Second, it is quickly created through > redirection but will clear existing content, which is suitable for initializing log files; Third, use echo"> file name to create a file with an empty string, or use echo-n""> file name to avoid line breaks. These three methods have their own applicable scenarios, and choosing the right method can help you complete the task more efficiently.

Are you looking for good software to write mathematical equations? If so, this article provides the top 5 equation editors that you can easily install on your favorite Linux distribution.In addition to being compatible with different types of mathema

dutree is a free, open-source, fast command-line tool for analyzing disk usage, written in the Rust programming language. It was created by combining durep (disk usage reporter) and tree (list directory content in tree-like format) command-line tools

Eclipse is a free integrated development environment (IDE) that programmers around the world use to write software, primarily in Java, but also in other major programming languages using Eclipse plugins.The latest release of Eclipse IDE 2023?06 does

ifconfig in short “interface configuration” utility for system/network administration in Unix/Linux operating systems to configure, manage, and query network interface parameters via command-line interface or in a system configuration scripts

Linux administrators should be familiar with the command-line environment. Since GUI (Graphical User Interface) mode in Linux servers is not commonly installed.SSH may be the most popular protocol to enable Linux administrators to manage the servers

Linux has a rich collection of commands, and while many of them are powerful and useful for various tasks, there are also some funny and whimsical commands that you can try out for amusement. 1. sl Command (Steam Locomotive) You might be aware of the
