5 fun Linux commands you'll want to try at least once


Vicki Jauron, Babylon and Beyond Photography/Getty Images

I’ve been using Linux for a very long time, and from day 1, the terminal window and command-line interface (CLI) have been an integral part of my work.

At the same time, I’ve learned that it’s OK to have a bit of fun with the terminal window. Over the years, I’ve done just that.

Let me paint a picture.

Also: This is the most helpful new Linux tool I’ve tried in years – here’s why and how I use it

Back in my early days of using Linux, I had a girlfriend who lived with me. She was in school, and I was busy trying to build a massive Linux community. (Sadly, those efforts didn’t pan out — but that was when Linux was pretty much unknown.) I had set up my home LAN such that I had SSH access to my desktop computer running (probably) an early version of Ubuntu. 

I also had connected a pair of old-school X11 remotes to lights and could control them via the command line.

When my girlfriend was home, I’d often SSH into that computer and turn on/off the lights from the command. I’d also pull other pranks that never failed to make her laugh or curse my name.

Many huzzahs were proclaimed.

So, yes, you can have fun with the Linux command line.

I will show you a few things you can do from a terminal window that aren’t just about administering your system, solving problems, or being productive.

Are you ready for this?

1. Play music

Yes, you can play music from the command line on Linux. With the help of the mpg123 command, you can play a song, an entire directory, shuffle play, loop a file, and even control the volume of the music being played. The mpg123 command is the same one I used in those early days to put a smile on my girlfriend’s face (when she’d hear our song out of nowhere). 

You can install mpg123 with one of the following commands:

  • sudo apt-get install mpg123 -y
  • sudo dnf install mpg321 -y
  • sudo pacman -S mpg123

Notice that the DNF install is for mpg321 and not mpg123. Mpg321 is a fork of mpg123 and works the same.

Also: 5 Linux commands I use to keep my device running smoothly

Once installed, you can play a song like so:

mpg123 /path/to/song.mp3

Or

mpg321 /path/to/song.mp3

The basic controls (while playing) are:

  • Space: Pause/Resume
  • Ctrl+C: Stop and exit
  • +: Increase volume
  • -: Decrease volume
  • f: Jump forward
  • b: Jump backward
  • q: Quit

2. Read a fortune

Most Linux distributions include the fortune command, which reads from a text file (filled with pithy sayings and fortunes) and prints it out in the terminal. To use the command, open a terminal and run:

fortune

Also: 5 best Linux distros for staying anonymous – when a VPN isn’t enough

Fortune is fairly basic, but you can do the following with it:

  • Display a short fortune message: fortune -s
  • Display a fortune from a specific file (local storage only): fortune /path/to/fortune/file
  • Display offensive fortunes: fortune -o
  • Display all fortunes, including offensive ones: fortune -a

Note: To display offensive fortunes, you have to install the fortunes-off package.

3. Lead a kitty around

Yes, I’m a crazy cat person (and proud of it). There’s a tiny command that, when run, produces a tiny animated kitty that will chase your cursor. It’s adorable and, for cat lovers, a must.

Also: The first 5 Linux commands every new user should learn

The app in question is oneko (Neko is one of the Japanese words for “cat”) and can be installed from the standard repositories (such as with the command sudo apt-get install oneko -y). When you run the command to start the kitty chasing your cursor, you won’t get your terminal prompt back, so you should run the command like so:

oneko &

When you’re done letting the kitty out of the terminal bag, you can end it with:

killall -9 oneko

The oneko kitty.

I finally grabbed a screenshot of the Oneko kitty sitting still.

Screenshot by Jack Wallen/ZDNET

4. Generate a fake identity

I’ve occasionally used this when needing an “NPC” character for a book. The command used for this is rig and is available from the standard repository (such as with sudo dnf install rig -y). When you run the rig command, it generates a fake identity including full name, address, and (fake) phone number. What’s really handy about this is that it generates geographically consistent information, so the city, state, and zip code information will be accurate. 

A sample fake identity generated by rig.

I’ve used this command to generate names for book characters.

Screenshot by Jack Wallen/ZDNET

With rig installed, you can simply run the command and view the output.

5. Read a file aloud

I’ve used this on several occasions to catch people off guard. Imagine their surprise when they hear a very old-school robotic voice speaking Hamlet’s “to be or not to be” monologue out of the blue. It’s fun. The app for this is espeak, which is found in the standard repositories (so it can be installed like sudo pacman -S espeak). Once installed, it can be used to speak a string of text like:

Also: I’m a command-line pro and this is the best terminal app I’ve ever used, thanks to AI

espeak “Hello, ZDNET!”

If you want it to read a file, it can be done like this:

cat hamlet.txt | espeak

The espeak app will read out everything in the hamlet.txt file

There you go — fun with the Linux terminal.

Get the biggest stories in tech every Friday with ZDNET’s Week in Review newsletter





Source link

Leave a Comment