The terminal is a very powerful tool, and it’s probably the most interesting part in Unix. Among the plethora of useful commands and scripts you can use, some seem less practical, if not completely useless. Here are some Bash commands that are fun, and some of them are useful as well.
Let’s check them out.
Few people know this, but any Unix system comes with a built-in calendar. To access it, you can simply type:
This will display the current month. However, you can select the precise year, and even the month, that you want as an argument. And to be fully useless, the option
-j displays Julian days (the number of days from January 1). To sum up:
This one stands for “Steam Locomotive” and is often typed in error (as it is the opposite of
ls). Judging how boring visuals are on the terminal, it is cool to periodically see a locomotive on your terminal, especially when you did not mean for it.
sl with this command typed in your terminal:
Then type the command:
A very peculiar command with only one ability: repeating a string until its process is killed. This command displays a string for an infinity until the command is killed. Just type:
yes I did it.
Don’t forget to press Ctrl + C to stop it, or it will run forever.
While it may seems useless, the
yes command is very handy when you are running scripts that wait for prompts that you need to automate. For example:
will give a “y” when a prompt asks for a “y/n” answer.
This command is for reversing any input (as its name suggests). When I say reverse, it means that if the input is “Linux,” the output will be “xuniL” It’s pretty strange, I know.
Enter an interactive mode and can quit by using the shortcut Ctrl + C. But rev can also work to reverse an entire file with:
Ever wondered what fire would look like on the black interface of the terminal? This can be achieved with the
The first step is to install aafire with the following code on your terminal:
Once it has been installed, on your terminal type:
If you are tired of hearing the everyday voices around you, this command could be your escape. You can listen to your computer talk by installing
espeak using this command:
After, run espeak using the command:
Note that whatever you type within the double quotation marks is what your computer will say.
Figlet is a command for those who love to write in ASCII art. It greatly simplifies this task as it automatically transforms any given string. It comes with a bunch of fonts by default at “/usr/share/figlet/fonts/,” and you can of course add your own.
Similar to figlet, display the text in a big banner format. Install it with the command:
and use the syntax:
This script basically displays a cow character using ascii symbols the arguments passed to it. First, install cowsay with this script:
Then type in the terminal:
Note: replace “yourtext” with whatever text you need to be displayed by the cow.
If you prefer a colorful pony to a cow, you can install the
ponysay package and its respective command:
This command is similar to
cowsay, with the only difference being the output is displayed as a thought. To use this command, just type:
fortune displays a random sentence in the same spirit as fortune cookies. It is not always installed by default, so you may want to add it. In Ubuntu:
It comes with a very handy option:
-s for short, which will limit it to fortunes composed of one sentence or less.
This command adds some spice to your terminal by adding a cat to your screen which will chase after your (mouse) cursor. Install it by running this script:
oneko to display the cat.
There is a
cat command, and “dog” is an alternative to “cat.” (See the humor?) 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, take a look at the manual page.
If you have seen the Hollywood movie Matrix, then you will relate easily to this command. Install cmatrix using the script:
Run it by typing
cmatrix in your terminal.
15. time cat
This is actually two commands
cat used together. You can use this as a built-in timer. It will run in the background until you stop it and will then report the time elapsed between the start and the end of its process. To launch it, just type:
It’s time to do some Math. Let’s do an easy one with the command
factor which can break down a given number into prime factors:
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. Therefore, it deserves to be in our list just for that. “w” allows you to see information about current users, like their name, login time, etc.
We, of course, know how important commands are, especially in a Linux terminal, but once in a while it is nice to take a break and just amuse yourself with these fun commands.
Our latest tutorials delivered straight to your inbox