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.
Installing curl to check 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 decorated way. To get weather information -
Open terminal. (shortcut : ctrl + alt + T) and type command :
Use wttr.in in terminal
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 command -
Check weather forecast of your location
To check Moon phase -
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 pre-bundled wget command by getting its output on terminal. By default, wget command stores output in file. You need to use -qO- command line parameter to get output on terminal screen.
That’s all for weather API. It's 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 couple of dependency before installing How2. So let's fix them first -
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:
How To Use How2 To Surf StackOverflow In Linux
Using how2 is simple as other Linux commands. It takes the following syntax -
It would search and display the result as shown in screenshot below:
To look for more alternatives hit SPACEBAR. You will see list of other related questions where in you can
select the most relevant to you.
To find answer for a partcular development language you can use -l param.
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.
Learn How To Create a Hacking / Penetration Testing Lab Join Course
Most Read This Week