Funny Linux Commands – Check Weather And Surf StackOverflow In Linux Terminal

Let’s have fun with Linux Terminal today. Also, if you are a developer, let’s reduce one context switch that you perform while development; switching to browser for solution in StackOverflow. It’s well-known fact, less context switch, less distraction and more productivity. In this article, we’ll explore two fun and useful things that you can do right through terminal without opening browser that you would do normally.

​Funny Linux Commands – Check Weather In Linux Terminal

Install curl [optional]​Before you can use the API of wttr.in(for weather info), you need to install curl in your system.

Install curl
$ sudo apt-get install curl

For fedora based system

$ sudo yum install curl
Installing curl to check the weather in Linux is optional. You can use wget command to get weather info as explained later in this section. When we talk about funny Linux commands, this is what actually means. It makes your Linux more productive and you get to know the other usage of Linux terminal as well.

Linux Weather App Through wttr.in

wttr.in provides api that returns weather information of location in the decorated way. To get weather information –

Open terminal. (shortcut : ctrl + alt + T) and type command :
Use wttr.in in terminal

curl wttr.in

The funny Linux commands show you weather forecast layout for your location for three days with current wind speed. It’s useful when you’re working in terminal and don’t want to move out of terminal. You can check the weather forecast immediately in the terminal, simply and quickly.

​To check weather forecast of particular place, you can use the command –
Check weather forecast of your location
curl wttr.in/location

Example:

curl wttr.in/PaloAlto

weather app in linux

To check Moon phase –
Check Moon phase
curl wttr.in/Moon

check moon phase

​Check Weather In Linux Terminal Using wget Command

The above method required curl to be installed. If you don’t want to install curl, then you can use the pre-bundled wget command by getting its output on the terminal. By default, wget command stores output in a file. You need to use -qO- command line parameter to get output on terminal screen.
For Example
wget -qO- wttr.in/Mumbai

weather app wittr in terminal through wget

That’s all for the weather API. It’s a small API from wttr.in for the weather forecast in terminal.

​Surfing Through StackOverflow In Terminal

Claudio Santini, A London based developer had an idea on this line, why not having stackoverflow.com surfing right through terminal. An opensource project how2 from Santini (hosted on gthub) exactly does this. Although the wiki page provides you help in installation of how2, let’s explore this utility.

​How To Install How2 To Surf StackOverflow In Terminal

There are a couple of dependencies before installing How2. So let’s fix them first –Install npm

Install npm
$ sudo apt-get update 

$ sudo apt-get dist-upgrade

Install nodejs

$ sudo apt-get install nodejs
$ sudo npm install -g how2

NOTE: There is a known bug in debian based Linux. It uses its internal node command instead of nodejs one. In case you encounter error even after successful installation:

ERROR : /usr/bin/env: node: No such file or directory
Do the following changes:
Fix issue
ln -s /usr/bin/nodejs /usr/bin/node

​How To Use How2 To Surf StackOverflow In Linux

Using how2 is simple as other Linux commands. It takes the following syntax –
How2 syntax
how2 [optionaParameter] your Query

Example

If I want to surf how to write if statement in shell script, I would type command:
how2 write if in shell script

It would search and display the result as shown in the screenshot below:

funny linux commands

To look for more alternatives hit SPACEBAR. You will see list of other related questions wherein you can
select the most relevant to you.

stackoverflow in linux terminal funny linux commands

​To find answer for a partcular development language you can use -l param.

stackoverflow in linux terminal

Example
how2 reverse list -l java

Conclusion

Tools like how2 and weather API would relieve you from context switching and increase your productivity. Moreover, you can get the solution on the fly. Keep exploring the utilities. How2 may not be perfect in all your queries but will surely come handy in solving 95% of your queries. On technical and development perspective, it saves you from opening web browser (also saving eating up of RAM :D). You can also contribute and raise the issues on the GitHub project of how2. So these were the funny Linux commands. Do leave suggestions, comments or questions in the comment section below.

Leave a Reply

Your email address will not be published. Required fields are marked *

linux system administration bootcamp