10 More Funny and/or Useless Linux Commands

10_more_funny_commands-mainNot so long ago, in a very, very close galaxy, I gave a top ten of the most funny and/or useless Linux commands — a collection of various (in)utilities that a lot of you commented on, proposing some additional commands, or explaining their function. Some of these comments were in fact very interesting and I think that the list should be updated, taking them into account. I therefore present another top ten list of the most funny and/or useless commands, including your opinions and just a little bit of mine, so that we have a list that goes to ten. Watch out though, because some of the commands listed here will not work by default and may require the installation of an extra package.

1. sl

Thanks to Asdasd, I discovered “sl”. An incredibly useless but very necessary program that just shows a train in ASCII art going through your terminal. Maybe one of the most appealing commands of this top ten.

10_more_funny_commands-sl

2. pi

Credit goes to cameronhorsburgh for bringing this one up. “pi” displays an approximation of PI, useful if you are making some calculation, I guess. The syntax is:

pi [number of digits to display]

10_more_funny_commands-pi

3. dog

Coats was the one to bring this one up. “dog” is an alternative to “cat” (see the humor?), as it uses the same syntax to display a text stream into the console. You will probably have to install it as it is not a command offered by default, but when you do, I invite you to take a look at the manual page.

10_more_funny_commands-dog

4. vdir

“vdir” is useless in that it is a redundancy. Its main function is to list the content of a directory, displaying the name of the files, the permissions, the dates of modification, the sizes, etc. However, all of this can be done via the good old command “ls” and its composite like

ls -l

10_more_funny_commands-vdir

5. clear

“clear” is also a redundancy. With this command, you will erase the lines from the terminal and “clear the screen.” But anyone adept with the console will save time by using the shortcut “Ctrl+l”, which does exactly the same thing.

10_more_funny_commands-clear

6. ul

An interesting command, “ul” can be used to underline characters in the terminal. I still have not figured it out completely but I know that, for example, it will transform

echo $'hello w\b_o\b_r\b_l\b_d\b_ ' | ul

into “hello world“. As you can guess, it replaces the meta-character “\b_” with an actual underlining.

10_more_funny_commands-ul

7. w

You can say whatever you want about “w”, but it is to my knowledge the shortest command you can find by default on your machine. And I think that it therefore deserves to be in our list just for that. Surprisingly, “w” allows you to see information about the current users, like their name, their login time, etc.

10_more_funny_commands-w

8. filters

A moore’s contribution: filters is a set of tools that transforms text to give it some phonetic accent. “man talkfilters” will give you the list of the possible accents. But as an example,

echo "make tech easier is cool" | fudd

will give “make tech easiew is coow ” which supposedly imitates Elmer Fudd’s accent (the guy who hunts Bugs Bunny in Looney Tunes). And one of my favorites, the filter “warez” will give you your input in H4x0r code. The previous example becomes “]\/[ak3 73k]-[ 3az13r YZ c0ol” with “warez” instead of “fudd” at the end of the command.

10_more_funny_commands-filters

9. fortune mods

Last time, I presented to you the famous fortune command which gives you a (relatively) short and random geek sentence each time you call it. However, if you can add your own fortunes to the database, it is also possible to download extensions, or mods, which add fortunes from a specific source, like Star Wars, the Chuck Norris facts, different languages, Matrix, Futurama, Calvin and Hobbes, and more. Install the mod that you want and do

fortune [name of the mod]

As an example, I installed the Chuck Norris fact extension in English, so by doing

fortune chucknorris

I get “Chuck Norris grinds his coffee with his teeth and boils the water with his own rage.”

10_more_funny_commands-fortune_mod

10. snow

Finally, a little script to end the top ten. I could not stop myself from sharing the snow.sh script from myh3r3.com which creates little snowflakes falling into your terminal. Copy-paste the code into a text file, name it “snow.sh”, make it executable, and launch it in a terminal to admire.

#!/bin/bash
 
LINES=$(tput lines)
COLUMNS=$(tput cols)
 
declare -A snowflakes
declare -A lastflakes
 
clear
 
function move_flake() {
i="$1"
 
if [ "${snowflakes[$i]}" = "" ] || [ "${snowflakes[$i]}" = "$LINES" ]; then
snowflakes[$i]=0
else
if [ "${lastflakes[$i]}" != "" ]; then
printf "\033[%s;%sH \033[1;1H " ${lastflakes[$i]} $i
fi
fi
 
printf "\033[%s;%sH*\033[1;1H" ${snowflakes[$i]} $i
 
lastflakes[$i]=${snowflakes[$i]}
snowflakes[$i]=$((${snowflakes[$i]}+1))
}
 
while :
do
i=$(($RANDOM % $COLUMNS))
 
move_flake $i
 
for x in "${!lastflakes[@]}"
do
move_flake "$x"
done
 
sleep 0.1
done

10_more_funny_commands-snow

Conclusion

First, I want to thank you all for your comments on the previous article. I tried to put here a synthesized version of what you reported in order to share it with more people. Of course, this list is still not complete, and even if I personally doubt that it will ever be, I still invite you to continue to share.

So again, if you can think of more, or if you have an example in mind of when these commands become handy, please leave us a comment.

Do you like what you read here?

Receive the latest update in your inbox.

24 Comments

  • kabamaru

    Haha, nice one!

    Although ‘clear’ is actually useful in scripts some times; it helps to easily unclutter the screen from previous output.

    Reply

    • A.J. Venter

      And it works when control keys aren’t accessible. Just ask anybody whose ever tried to work on a server on the other side of the world via somebody else’s SSH session which is running in a VNC session and which you’re seeing in a web-ex session…

      Reply

  • A.J. Venter

    Actually w just an alias for the who command -and there is nothing useless about that, unix sysadmins have relied on that command for decades to do their jobs – Linux admins are no different. Top-of-my-head example: you need to install a new hard-drive in a box, this requires you to shut it down but before you can do that you should check if anybody else is currently using the machine and tell them to save their work and log out – w to the rescue.

    Reply

    • bohoomil

      /usr/bin/w belongs to procps
      /usr/bin/who belongs to coreutils

      They both do something similar, but their output differs and generically none of them is an alias of the other.

      Reply

    • Pekka Niemi

      Furthermore, the load averages are “the thing” in w. Granted, there is also top and variants, but w gives you a quick glance how the system is doing.

      Reply

  • Haribo Mueller

    clear is in fact very useful in shell scripts! E.g. many installation scripts clear the terminal screen after each completed step.

    Reply

  • Michael

    Like others already wrote above: ‘clear’ is very useful, – especially in scripts.
    Apart from that: Great list. Some of them are completely new to me.

    Reply

  • Calame

    I use the “w” command to see the load average of the machine and many of old sysadm used to do so

    Reply

  • Pekka Niemi

    b stands for “backspace”. Combination of b and _ was useful in the old times with line/matrix printers.

    Reply

  • Stefan

    FWIW, most of these are external commands that don’t ship with other distros (Open Suse).

    Also I think CTRL+I displays contents of my Path or /usr/bin or something.

    Nonetheless, this was an interesting read even if only one or two of them worked for me. :)

    Reply

    • Adrien

      Well, yeah, you have to install a few packages. I am on Archlinux, and a lot of them are not shipped by default. But a little rpm for Open Suse should do the work for most of them.

      Reply

  • papoanaya

    Considering that I type ‘tput clear” rather than clear to do a control-l on the terminal, I’m not sure if that’s being redundant or a luddite :). Back in the days there was not any “clear”  and control-l only worked on certain programs. The only sure way to do it was to type tput (terminal put) clear to clear the console.

    Reply