See the weather in the terminal on Ubuntu

Share with:

FacebookTwitterGoogleVkontakteTumblrStumbleUponLinkedInRedditPinterestPocketDigg

Just one command and you’re done!
The tools offered by desktop environments dedicated to the Linux-based operating systems are numerous, however, viewing the weather in the terminal always has its charm, especially if you do it just with one command.
And that command is offered from Wego application and web service companion wttr: in particular, thanks to curl, we can exploit this to view the weather in the terminal without going through other third-party apps, and above all without installing the wttr server! Only two fundamental requirements for this process to work: to be connected to the Internet and have access to the utility curl (which, as you’ll discover shortly, is easily installed from the system repository).

 

wego
We used as reference the operating system Ubuntu, but you can replicate the process on any other Linux distribution.

Installation Steps:

The first thing to do, if there is not already, is to install the curl utility that will help us to conveniently access the web service; This is among the repository of almost all Linux distributions. To proceed on Debian, Ubuntu, and in general all the debian-based simply type
sudo apt install curl
followed by Enter. Alternatively you can use the manager of your distribution (dnf, yum, rpm, emerges and so on) to achieve the same result. At this point it’s done: to show the weather in the Linux terminal simply type the command
curl wttr.in/city_name
Wttr.in also provides other options (such as displaying the moon phases or units with USCS system), which you can view by typing instead
curl wttr.in/?help
If desired, you can create an alias that allows you to view the weather in your town just by typing “weather.”
To do so, simply type terminal
echo "alias meteo='curl wttr.in/nome_citta'" >> ~/.bashrc
and finally,
source ~/.bashrc
From now on, every time you go to type in your terminal, you can view weather forecasts for your city.
TIP: could also be a nice MOTD for a Linux server.

Share with:

FacebookTwitterGoogleVkontakteTumblrStumbleUponLinkedInRedditPinterestPocketDigg

Leave a Reply

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