Home Linux 24 Hilarious Linux Commands That Will Make You Laugh

24 Hilarious Linux Commands That Will Make You Laugh

0
24 Hilarious Linux Commands That Will Make You Laugh


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 Debian, Ubuntu and Mint]
$ sudo yum install sl         [On RHEL/CentOS/Fedora and Rocky/AlmaLinux]
$ sudo emerge -a sys-apps/sl  [On Gentoo Linux]
$ sudo apk add sl             [On Alpine Linux]
$ sudo pacman -S sl           [On Arch Linux]
$ sudo zypper install sl      [On OpenSUSE]    

After installation, you can try running the sl command by simply typing.

$ sl
sl Command in Linux
sl Command in Linux

2. telnet Command

The telnet command is a text-oriented bidirectional network protocol that allows you to connect to remote systems and interact with them using a text-based interface.

Install telnet Command

$ sudo apt install telnet         [On Debian, Ubuntu and Mint]
$ sudo yum install telnet         [On RHEL/CentOS/Fedora and Rocky/AlmaLinux]
$ sudo emerge -a sys-apps/telnet  [On Gentoo Linux]
$ sudo apk add telnet             [On Alpine Linux]
$ sudo pacman -S telnet           [On Arch Linux]
$ sudo zypper install telnet      [On OpenSUSE]    

For example, to establish a connection to the IP address of the remote system on port 22, which is commonly used for SSH (Secure Shell) connections.

$ telnet 192.168.0.135 22
Check SSH Port is Open
Check SSH Port is Open

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 Debian, Ubuntu and Mint]
$ sudo yum install fortune         [On RHEL/CentOS/Fedora and Rocky/AlmaLinux]
$ sudo emerge -a sys-apps/fortune  [On Gentoo Linux]
$ sudo apk add fortune             [On Alpine Linux]
$ sudo pacman -S fortune           [On Arch Linux]
$ sudo zypper install fortune      [On OpenSUSE]    

After installation, you can try running the fortune command by simply typing.

$ fortune
Show Quotes in Command Line
Show Quotes in Command Line

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
Reverse Words in Linux
Reverse Words in Linux

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
Calculates Prime Factors of Number
Calculates Prime Factors of Number

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.

Prints Multiplication Table in Linux
Prints Multiplication Table in Linux

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 Debian, Ubuntu and Mint]
$ sudo yum install cowsay         [On RHEL/CentOS/Fedora and Rocky/AlmaLinux]
$ sudo emerge -a sys-apps/cowsay  [On Gentoo Linux]
$ sudo apk add cowsay             [On Alpine Linux]
$ sudo pacman -S cowsay           [On Arch Linux]
$ sudo zypper install cowsay      [On OpenSUSE]    

After installation, you can try running the cowsay command by simply typing.

$ cowsay I Love Tecmint.com
$ cowsay I Love Linux
Generate ASCII Art of Text
Generate ASCII Art of Text

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 
Display Random Fortune Message
Display Random Fortune Message

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 Debian, Ubuntu and Mint]
$ sudo yum install xcowsay         [On RHEL/CentOS/Fedora and Rocky/AlmaLinux]
$ sudo emerge -a sys-apps/xcowsay  [On Gentoo Linux]
$ sudo apk add xcowsay             [On Alpine Linux]
$ sudo pacman -S xcowsay           [On Arch Linux]
$ sudo zypper install xcowsay      [On OpenSUSE]    

Once xcowsay is installed, you can launch it by running:

$ xcowsay I Love Tecmint.com
Show Animated ASCII Art in Linux
Show Animated ASCII Art on Linux

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
Prints Continuous Stream of Text
Prints Continuous Stream of Text

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 Debian, Ubuntu and Mint]
$ sudo yum install toilet         [On RHEL/CentOS/Fedora and Rocky/AlmaLinux]
$ sudo emerge -a sys-apps/toilet  [On Gentoo Linux]
$ sudo apk add toilet             [On Alpine Linux]
$ sudo pacman -S toilet           [On Arch Linux]
$ sudo zypper install toilet      [On OpenSUSE]    

Once the toilet is installed, you run the command with the text you want to convert into an ASCII banner.

$ toilet TecMint.com 
Generate Text Banner in Linux
Generate Text Banner in Linux

If you want to print the banner in a large font, you can run:

$ toilet -f big TecMint.com
Print Large Text Banner in Linux
Print Large Text Banner on Linux

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 Debian, Ubuntu and Mint]
$ sudo yum install cmatrix         [On RHEL/CentOS/Fedora and Rocky/AlmaLinux]
$ sudo emerge -a sys-apps/cmatrix  [On Gentoo Linux]
$ sudo apk add cmatrix             [On Alpine Linux]
$ sudo pacman -S cmatrix           [On Arch Linux]
$ sudo zypper install cmatrix      [On OpenSUSE]    

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
Show Animated Matrix Like Text in Linux
Show Animated Matrix Like Text in Linux

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 Debian, Ubuntu and Mint]
$ sudo yum install oneko         [On RHEL/CentOS/Fedora and Rocky/AlmaLinux]
$ sudo emerge -a sys-apps/oneko  [On Gentoo Linux]
$ sudo apk add oneko             [On Alpine Linux]
$ sudo pacman -S oneko           [On Arch Linux]
$ sudo zypper install oneko      [On OpenSUSE]    

Once oneko is installed, you run the command to see a small animated cat on your screen.

$ oneko
Show Animated Mouse Cat in Linux
Show Animated Mouse Cat on Linux

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
Prints Current Date and Time in Linux
Prints Current Date and Time in Linux

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 Debian, Ubuntu and Mint]
$ sudo yum install espeak         [On RHEL/CentOS/Fedora and Rocky/AlmaLinux]
$ sudo emerge -a sys-apps/espeak  [On Gentoo Linux]
$ sudo apk add espeak             [On Alpine Linux]
$ sudo pacman -S espeak           [On Arch Linux]
$ sudo zypper install espeak      [On OpenSUSE]    

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 Debian, Ubuntu and Mint]
$ sudo yum install aalib         [On RHEL/CentOS/Fedora and Rocky/AlmaLinux]
$ sudo emerge -a sys-apps/aalib  [On Gentoo Linux]
$ sudo apk add aalib             [On Alpine Linux]
$ sudo pacman -S aalib           [On Arch Linux]
$ sudo zypper install aalib      [On OpenSUSE]    

Once aafire is installed, you run the command to see a fire animation in your terminal.

$ aafire
Show Fire in Linux
Show Fire in Linux

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 Debian, Ubuntu and Mint]
$ sudo yum install bb         [On RHEL/CentOS/Fedora and Rocky/AlmaLinux]
$ sudo emerge -a sys-apps/bb  [On Gentoo Linux]
$ sudo apk add bb             [On Alpine Linux]
$ sudo pacman -S bb           [On Arch Linux]
$ sudo zypper install bb      [On OpenSUSE]    

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%20status%20message" "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
Show ASCIIquarium in Linux
Show ASCIIquarium in Linux

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 Debian, Ubuntu and Mint]
$ sudo yum install funny-manpages         [On RHEL/CentOS/Fedora and Rocky/AlmaLinux]
$ sudo emerge -a sys-apps/funny-manpages  [On Gentoo Linux]
$ sudo apk add funny-manpages             [On Alpine Linux]
$ sudo pacman -S funny-manpages           [On Arch Linux]
$ sudo zypper install funny-manpages      [On OpenSUSE]    

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
Linux Funny Man Pages
Linux Funny Man Pages

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 Debian, Ubuntu and Mint]
$ sudo yum install pv         [On RHEL/CentOS/Fedora and Rocky/AlmaLinux]
$ sudo emerge -a sys-apps/pv  [On Gentoo Linux]
$ sudo apk add pv             [On Alpine Linux]
$ sudo pacman -S pv           [On Arch Linux]
$ sudo zypper install pv      [On OpenSUSE]    

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 
Show Animated Text in Terminal
Show Animated Text in the Terminal

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 Debian, Ubuntu and Mint]
$ sudo yum install rig         [On RHEL/CentOS/Fedora and Rocky/AlmaLinux]
$ sudo emerge -a sys-apps/rig  [On Gentoo Linux]
$ sudo apk add rig             [On Alpine Linux]
$ sudo pacman -S rig           [On Arch Linux]
$ sudo zypper install rig      [On OpenSUSE]    

Once installed, you can use the rig command to generate random identities.

$ rig
Generate Fake Identities in Linux
Generate Fake Identities in Linux

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 Debian, Ubuntu and Mint]
$ sudo yum install aview         [On RHEL/CentOS/Fedora and Rocky/AlmaLinux]
$ sudo emerge -a sys-apps/aview  [On Gentoo Linux]
$ sudo apk add aview             [On Alpine Linux]
$ sudo pacman -S aview           [On Arch Linux]
$ sudo zypper install aview      [On OpenSUSE]    

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
View Image in Linux Terminal
View Image in Linux Terminal

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 Debian, Ubuntu and Mint]
$ sudo yum install xeyes         [On RHEL/CentOS/Fedora and Rocky/AlmaLinux]
$ sudo emerge -a sys-apps/xeyes  [On Gentoo Linux]
$ sudo apk add xeyes             [On Alpine Linux]
$ sudo pacman -S xeyes           [On Arch Linux]
$ sudo zypper install xeyes      [On OpenSUSE]    

Once installed, run:

$ xeyes
Show Pair of Eyes in Linux
Show Pair of Eyes in Linux

24. Linux Tweaks

It is time for you to have some one-liner Linux tweaks to have some fun in the terminal.

$ world

bash: world: not found
$ touch girls\ boo** 

touch: cannot touch `girls boo**': Permission denied
$ nice man woman

No manual entry for woman
$ ^How did the sex change operation go?^ 

bash: :s^How did the sex change operation go?^ : substitution failed
$ %blow 

bash: fg: %blow: no such job
$ make love 

make: *** No rule to make target `love'.  Stop.
$ [ whereis my brain?      
              
sh: 2: [: missing ]
$ % man: why did you get a divorce? 

man:: Too many arguments.
$ % !:say, what is saccharine? 

Bad substitute.
$ \(- 

bash: (-: command not found

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.





Source link

netbalaban news