If you are a Linux sysadmin, you tend to spend a lot of time on the command line. Over the years I have learned to do much of my work without ever touching the mouse. Also, if I open a browser it is just too easy to be distracted. Social media, news articles, and funny cat videos all are designed to suck you in, and it works. In this countdown we will explore 5 things you can do from the command line to keep you productive and break your dependence on the GUI.

Check the Weather on the Command Line

Never leave the command line again to check the weather in your browser. Simply use curl to pull the weather like so:

curl wttr.in

By default the above URL will give you the current weather and an overview including the next 2 days. It pulls your location from your IP address, but you can specify that as well.

I like to call just the small output of the current weather.

Animated GIF showing how to display the current weather on the Linux command line

You have a lot of options to customize it however you like. You can use 3 letter airport codes, change weather units, get the moon phases, and format the output in different ways. It also supports many different languages.

Once you have the command output the way you like it, use an alias to quickly call the weather from anywhere on the command line.

For all the options and configurations see the wttr.in project on Github.

Do Calculations On The Command Line (calculator)

All modern Linux systems running a graphical environment include a calculator, but sometimes it's nice to stay cozy on the command line. It's more convenient to type the digits in the calculator anyway, the mouse is overrated. Here is where bc command comes in.

Animated Gif showing how to use the bc command line calculator in Linux

The bc command allows you to do simple math, use base 2 (binary) or base 16 (hex) math, and a lot more. I am bad at math so I use this more than I would like to admit.

Most systems come with bc installed, but you can simply install it if not.

Red Hat / CentOS

sudo yum install bc

Debian / Ubuntu

sudo apt-get install bc

To learn more about how to use bc read "bc: Comand Line Calculator" at Fedora Magazine.

The Command Line Dictionary

The command line dictionary (dictd) is a great little tool to have at your disposal. It is available on any Linux distro and allows you to use online or local databases.

In addition to providing definitions for words, you can also use it for language translations and synonyms.

Animated GIF showing how to use dictd the command line dictionary.

To learn more about dictd and how to use it read "How to Use the Linux Command Line Dictionary".

Google Search From the Command Line

googler is a power tool to Google (Web & News) and Google Site Search from the command-line. It shows the title, URL and abstract for each result, which can be directly opened in a browser from the terminal. Results are fetched in pages (with page navigation). Supports sequential searches in a single googler instance.

- From the GitHub Project Page

Ever since I found this project I have been using it more and more. It allows you to do a google search for any topic from the command line. Once you find the result you are looking for you can select it's respective number and it will open directly in a browser. If you are working on a headless server without a graphical interface you can pair it with a text based browser like lynx.

Below is an example of googler being used with the lynx text based browser. First I use googler to pull up search results then open the first result in the lynx browser.

Animated gif showing how to do a google search on the Linux command line

You can install googler easily with most package managers (i.e. apt-get install googler or dnf install googler). It can also be installed with snap and brew.

To learn more check out the googler project page on GitHub.

Spell Check on the Command Line

In a browser or word processor spell check is common place, on the command line not so much. Aspell is a utility that checks spelling in plain text files.

GNU Aspell opens a given text file in a two-pane interactive editor. When it finds a word that does not match it's dictionary it will ask how you want to proceed. You can select the correctly spelled word by number, choose to ignore it, or choose to to act on all future references to said word.

Here is an example of Aspell in action.

Animated gif showing aspell speck checker being used on the Linux command line

Aspell can easily be installed using your package manager.

dnf install aspell

or

apt-get install aspell

When I first installed it, I received the following error:

Error: No word lists can be found for the language "en_US".

I fixed this by installing the Aspell English dictionary package like so:

sudo dnf install aspell-en

To learn more about using Aspell read "How to check spelling at the Linux command line with Aspell" at opensource.com.

Conclusion

I find that the more I stay away from the browser the more productive I am. If I open a browser to search for the syntax of a command I am bombarded with opportunities to waste time. By using tools like the 5 mentioned here, I avoid things like funny cat videos that kill productivity.

I hope you enjoyed this article. Don't forget to follow us on Twitter, Facebook and subscribe to our YouTube channel. We also have a newsletter if you are interested in getting Linux articles delivered to your inbox.

Sound off below if you have any more tricks for avoiding the distractions of the GUI.