Linux Funny and Interesting Command

Sathya Narayana
5 min readMay 2, 2022

bb — an ASCII-art demo

1. Cowsay

The cowsay command draws out little animals using ASCII art in the terminal or shell. It is not very graphical but does a nice job at the drawing. On Ubuntu or Debian or systems you can install cowsay with apt, For RHEL and Fedora, you can install using Yum.

$ sudo apt-get install cowsay$ sudo yum install cowsay$ cowsay "Hi, How are you"
_________________
< Hi, How are you >
-----------------
\ ^__^
\ (oo)\_______
(__)\ )\/\
||----w |
|| ||
Don't like cows ? No problem there are other animals in the cow zoo. To find out how many, use the l option to get a list
$ cowsay -l
Cow files in /usr/share/cowsay/cows:
apt beavis.zen bong bud-frogs bunny calvin cheese cock cower daemon default
dragon dragon-and-cow duck elephant elephant-in-snake eyes flaming-sheep
ghostbusters gnu head-in hellokitty kiss kitty koala kosh luke-koala
mech-and-cow meow milk moofasa moose mutilated pony pony-smaller ren sheep
skeleton snowman sodomized-sheep stegosaurus stimpy suse three-eyes turkey
turtle tux unipony unipony-smaller vader vader-koala www
$ cowsay -f ghostbusters Who you Gonna Call
____________________
< Who you Gonna Call >
--------------------
\
\
\ __---__
_- /--______
__--( / \ )XXXXXXXXXXX\v.
.-XXX( O O )XXXXXXXXXXXXXXX-
/XXX( U ) XXXXXXX\
/XXXXX( )--_ XXXXXXXXXXX\
/XXXXX/ ( O ) XXXXXX \XXXXX\
XXXXX/ / XXXXXX \__ \XXXXX
XXXXXX__/ XXXXXX \__---->
---___ XXX__/ XXXXXX \__ /
\- --__/ ___/\ XXXXXX / ___--/=
\-\ ___/ XXXXXX '--- XXXXXX
\-\/XXX\ XXXXXX /XXXXX
\XXXXXXXXX \ /XXXXX/
\XXXXXX > _/XXXXX/
\XXXXX--__/ __-- XXXX/
-XXXXXXXX--------------- XXXXXX-
\XXXXXXXXXXXXXXXXXXXXXXXXXX/
""VXXXXXXXXXXXXXXXXXXV""

There are lots of other animal ASCII arts in the collection like dragons, elephants, koalas, and lot others. The cowsay command supports quite a few options to modify the behavior of the cows. Check the man page.

2. Cowthink

The cow can do more than just talk, it can even think. To make the cow think, use the cowthink command.

$ cowthink "Hmm, I didn't know that"
_________________________
( Hmm, I didn't know that )
-------------------------
o ^__^
o (oo)\_______
(__)\ )\/\
||----w |
|| ||

All animals of the cow zoo can think, and the command is similar to the earlier one.

3. sl — Steam Locomotive

$ sudo apt-get install sl$ sudo yum install sl

With the sl command, a steam locomotive will run across your terminal from right to left. The sl command has 2–3 additional options, that can be found in the man pages.

4. figlet — draw banners

The figlet command can be used to draw large-sized text banners. I remember seeing such banners as the welcome message of socket daemons/services when connecting via telnet.

$ figlet Welcome
__ __ _
\ \ / /__| | ___ ___ _ __ ___ ___
\ \ /\ / / _ \ |/ __/ _ \| '_ ` _ \ / _ \
\ V V / __/ | (_| (_) | | | | | | __/
\_/\_/ \___|_|\___\___/|_| |_| |_|\___|

5. toilet — draw banners again

The toilet command is similar to the figlet command, that it draws large-sized text banners using smaller characters.

$ toilet Welcome
m m ""#
# # # mmm # mmm mmm mmmmm mmm
" #"# # #" # # #" " #" "# # # # #" #
## ##" #"""" # # # # # # # #""""
# # "#mm" "mm "#mm" "#m#" # # # "#mm"

The toilet commands support a wide range of options like Unicode support, colored fonts, filters, etc. Check out the man page. To draw the text in a bit different way, try the following command

$ toilet -f mono12 -F metal Linux

6. banner

The banner command too can print banners like figlet and toilet but it is very limited. No options and can print only 10 characters at most.

$ banner Wonder
# #
# # # #### # # ##### ###### ######
# # # # # ## # # # # # #
# # # # # # # # # # ##### # #
# # # # # # # # # # # #####
# # # # # # ## # # # # #
## ## #### # # ##### ###### # #

But quick and handy.

7. fortune

The fortune command will put up a random, but hopefully sensible quote, or your fortune for the day.

$ fortune -s
Don't tell any big lies today. Small ones can be just as effective.

The s option tells the fortune command to generate only small sized messages.

The cow can be made to say the fortune like this

$ fortune | cowsay
______________________________________
/ You like to form new friendships and \
\ make new acquaintances. /
--------------------------------------
\ ^__^
\ (oo)\_______
(__)\ )\/\
||----w |
|| ||

8. rev — Reverse text and files

The rev command will print the reverse of whatever you type in. First, run rev, then start typing one sentence at a time

$ rev
hello
olleh
what ?
? tahw
this is super cool
looc repus si siht

9. Loop with yes

The yes command will go on printing the same thing indefinitely until stopped by a Ctrl+C. The command apparently appears to have no use, but in scenarios like software testing it is often needful to produce large amounts of junk text quickly and that is where tools like this come in handy.

$ yes start
start
start
start
start
... keeps going on infinite

10. factor — factorize numbers

This command would print out all the lowest common multiple (LCM) factors of any given number.

$ factor 60
60: 2 2 3 5

If you still remember your school maths, factoring a prime number would produce only the number itself and no factors.

11. pi — The Constant

The pi command prints the mathematical constant PI to any number of decimal figures. So let us print it to the first 500 figures after the decimal.

$ pi 50
3.1415926535897932384626433832795028841971693993751

12. Xcowsay

xcowsay is the GUI version of the cowsay command, and you need a running desktop (X display) to use it. It cannot work solely from a terminal.

$ xcowsay "hello"

13. xeyes

Xeyes is also a GUI program that draws a pair of eyes on the desktop which follows the mouse cursor. The eyes would look where ever the mouse cursor goes.

Just run the command and see the output

$ xeyes

14. asciiviewer — convert images to ascii art

Since the terminal is limited to only text, tools like asciiviewer are often useful to generate images out of the pure text. And to do this you need the tool called asciiviewer

$ sudo apt-get install aview

And now convert any images to ASCII art using this simple command

$ asciiview Tux.png -driver curses

15. rig

The rig command generates random and possibly fake identities.

$ rig
Bettye Dunlap
799 Second St
Denver, CO 80202
(303) xxx-xxxx

Conclusion

Those were some entertaining commands for the Linux users. If you know of any other commands that can do cool stuff inside the shell, then let me know in the comment section.

--

--