How To Check Weather Details From Command Line In Linux

Question: How can I find the weather details of my home town from command line in Linux without installing any additional softwares/applications?

Answer: This is easy! You don’t have to install any extra utilities. We can use ‘curl’ command, which is installed by default in most Linux and Unix distributions, to display the weather details.

If it is not installed, no worries, you can install it as shown below.

On Arch Linux and its derivatives:

sudo pacman -S curl

On Debian / Ubuntu / Linux Mint:

sudo apt-get install curl

On RHEL / CentOS / Fedora:

sudo yum install curl

Or,

sudo dnf install curl

On SUSE/openSUSE:

sudo zypper in curl

Check Weather Details From Command Line In Linux and Unix

Now, let us see how to check weather details from command line using wttr.in utility with curl command. wttr.in is a web front-end for a utility called Wego. Wego is a command line utility used to display the weather details of given location. Since wttr.in is a web-based utility, we don’t need to install it or any other additional utilities. We can get the weather details using wttr.in and curl either from command line or a web browser in no time.

Using wttr.in utility, we can display weather details,

  • of the Current location,
  • of a particular location,
  • using domain name or IP address,
  • using Zip code,
  • using Airport code,
  • of moon phase.

Let us see one by one.

Display weather details of current location

Open up your Terminal and run:

curl wttr.in

The above command will display the weather details of your current location based on your IP address.

Sample output:

Weather for City: Chennai, India

\ / Partly cloudy
 _ /"".-. 29 – 32 °C 
 \_( ). ↓ 15 km/h 
 /(___(__) 6 km 
 0.0 mm 
 ┌─────────────┐ 
┌──────────────────────────────┬───────────────────────┤ Tue 27. Dec ├───────────────────────┬──────────────────────────────┐
│ Morning │ Noon └──────┬──────┘ Evening │ Night │
├──────────────────────────────┼──────────────────────────────┼──────────────────────────────┼──────────────────────────────┤
│ \ / Sunny │ \ / Sunny │ \ / Partly cloudy │ \ / Partly cloudy │
│ .-. 27 – 29 °C │ .-. 30 – 33 °C │ _ /"".-. 27 – 29 °C │ _ /"".-. 25 – 27 °C │
│ ― ( ) ― ↗ 21 – 24 km/h │ ― ( ) ― ↓ 26 – 29 km/h │ \_( ). ↓ 24 – 31 km/h │ \_( ). ↓ 21 – 35 km/h │
│ `-’ 10 km │ `-’ 10 km │ /(___(__) 10 km │ /(___(__) 10 km │
│ / \ 0.0 mm | 0% │ / \ 0.0 mm | 0% │ 0.0 mm | 0% │ 0.0 mm | 0% │
└──────────────────────────────┴──────────────────────────────┴──────────────────────────────┴──────────────────────────────┘
 ┌─────────────┐ 
┌──────────────────────────────┬───────────────────────┤ Wed 28. Dec ├───────────────────────┬──────────────────────────────┐
│ Morning │ Noon └──────┬──────┘ Evening │ Night │
├──────────────────────────────┼──────────────────────────────┼──────────────────────────────┼──────────────────────────────┤
│ _`/"".-. Patchy rain po…│ \ / Partly cloudy │ \ / Partly cloudy │ Overcast │
│ ,\_( ). 28 – 30 °C │ _ /"".-. 29 – 33 °C │ _ /"".-. 28 – 32 °C │ .--. 27 – 30 °C │
│ /(___(__) ↙ 23 – 27 km/h │ \_( ). ↙ 24 – 28 km/h │ \_( ). ↙ 21 – 24 km/h │ .-( ). ↙ 19 – 22 km/h │
│ ‘ ‘ ‘ ‘ 10 km │ /(___(__) 10 km │ /(___(__) 10 km │ (___.__)__) 10 km │
│ ‘ ‘ ‘ ‘ 0.0 mm | 11% │ 0.1 mm | 15% │ 0.0 mm | 0% │ 0.0 mm | 0% │
└──────────────────────────────┴──────────────────────────────┴──────────────────────────────┴──────────────────────────────┘
 ┌─────────────┐ 
┌──────────────────────────────┬───────────────────────┤ Thu 29. Dec ├───────────────────────┬──────────────────────────────┐
│ Morning │ Noon └──────┬──────┘ Evening │ Night │
├──────────────────────────────┼──────────────────────────────┼──────────────────────────────┼──────────────────────────────┤
│ \ / Sunny │ \ / Sunny │ \ / Partly cloudy │ \ / Partly cloudy │
│ .-. 27 – 29 °C │ .-. 28 – 31 °C │ _ /"".-. 28 – 32 °C │ _ /"".-. 26 – 29 °C │
│ ― ( ) ― ↙ 21 – 24 km/h │ ― ( ) ― ↙ 23 – 27 km/h │ \_( ). ↙ 20 – 23 km/h │ \_( ). ↙ 18 – 22 km/h │
│ `-’ 10 km │ `-’ 10 km │ /(___(__) 10 km │ /(___(__) 10 km │
│ / \ 0.0 mm | 0% │ / \ 0.0 mm | 0% │ 0.0 mm | 0% │ 0.0 mm | 0% │
└──────────────────────────────┴──────────────────────────────┴──────────────────────────────┴──────────────────────────────┘

Check new Feature: wttr.in/Moon or wttr.in/Moon@2016-Mar-23 to see the phase of the Moon
Follow @igor_chubin for wttr.in updates

Display weather details of a particular location

You can even get a particular region weather details. For example, to display the weather details of Erode, a small district in Tamilnadu state, India.

curl wttr.in/erode

Replace “Erode” with your home town name to get the weather details. This command should work on almost all Linux and Unix operating systems.

Sample output:

Weather for City: Erode, India

\ / Sunny
 .-. 29 °C 
 ― ( ) ― ↓ 12 km/h 
 `-’ 10 km 
 / \ 0.0 mm 
 ┌─────────────┐ 
┌──────────────────────────────┬───────────────────────┤ Tue 27. Dec ├───────────────────────┬──────────────────────────────┐
│ Morning │ Noon └──────┬──────┘ Evening │ Night │
├──────────────────────────────┼──────────────────────────────┼──────────────────────────────┼──────────────────────────────┤
│ \ / Sunny │ \ / Sunny │ \ / Sunny │ \ / Partly cloudy │
│ .-. 27 – 28 °C │ .-. 32 °C │ .-. 30 – 32 °C │ _ /"".-. 27 – 31 °C │
│ ― ( ) ― ↓ 11 – 12 km/h │ ― ( ) ― ↙ 13 – 15 km/h │ ― ( ) ― ↙ 12 – 18 km/h │ \_( ). ↙ 10 – 22 km/h │
│ `-’ 10 km │ `-’ 10 km │ `-’ 10 km │ /(___(__) 10 km │
│ / \ 0.0 mm | 0% │ / \ 0.0 mm | 0% │ / \ 0.0 mm | 0% │ 0.0 mm | 1% │
└──────────────────────────────┴──────────────────────────────┴──────────────────────────────┴──────────────────────────────┘
 ┌─────────────┐ 
┌──────────────────────────────┬───────────────────────┤ Wed 28. Dec ├───────────────────────┬──────────────────────────────┐
│ Morning │ Noon └──────┬──────┘ Evening │ Night │
├──────────────────────────────┼──────────────────────────────┼──────────────────────────────┼──────────────────────────────┤
│ Overcast │ _`/"".-. Light rain sho…│ \ / Partly cloudy │ \ / Partly cloudy │
│ .--. 26 – 28 °C │ ,\_( ). 31 – 33 °C │ _ /"".-. 30 – 34 °C │ _ /"".-. 26 – 29 °C │
│ .-( ). ↓ 10 – 12 km/h │ /(___(__) ↙ 11 – 13 km/h │ \_( ). ↙ 12 – 16 km/h │ \_( ). ↙ 9 – 16 km/h │
│ (___.__)__) 10 km │ ‘ ‘ ‘ ‘ 10 km │ /(___(__) 10 km │ /(___(__) 10 km │
│ 0.0 mm | 0% │ ‘ ‘ ‘ ‘ 0.1 mm | 29% │ 0.1 mm | 22% │ 0.0 mm | 4% │
└──────────────────────────────┴──────────────────────────────┴──────────────────────────────┴──────────────────────────────┘
 ┌─────────────┐ 
┌──────────────────────────────┬───────────────────────┤ Thu 29. Dec ├───────────────────────┬──────────────────────────────┐
│ Morning │ Noon └──────┬──────┘ Evening │ Night │
├──────────────────────────────┼──────────────────────────────┼──────────────────────────────┼──────────────────────────────┤
│ Overcast │ \ / Partly cloudy │ \ / Sunny │ \ / Clear │
│ .--. 27 – 28 °C │ _ /"".-. 30 – 32 °C │ .-. 30 – 33 °C │ .-. 27 – 29 °C │
│ .-( ). ↓ 12 – 14 km/h │ \_( ). ↙ 12 – 13 km/h │ ― ( ) ― ↙ 11 – 15 km/h │ ― ( ) ― ↙ 10 – 18 km/h │
│ (___.__)__) 10 km │ /(___(__) 10 km │ `-’ 10 km │ `-’ 10 km │
│ 0.0 mm | 0% │ 0.0 mm | 1% │ / \ 0.0 mm | 1% │ / \ 0.0 mm | 0% │
└──────────────────────────────┴──────────────────────────────┴──────────────────────────────┴──────────────────────────────┘

Check new Feature: wttr.in/Moon or wttr.in/Moon@2016-Mar-23 to see the phase of the Moon
Follow @igor_chubin for wttr.in updates

Display weather details using domain name or IP address

You can also use domain name prefixed with ‘@’ as a location specificator.

curl wttr.in/@ostechnix.com

Sample output:

Weather for City: Brea, United States of America

\ / Clear
 .-. 13 – 14 °C 
 ― ( ) ― ↙ 11 km/h 
 `-’ 16 km 
 / \ 0.0 mm 
 ┌─────────────┐ 
┌──────────────────────────────┬───────────────────────┤ Mon 26. Dec ├───────────────────────┬──────────────────────────────┐
│ Morning │ Noon └──────┬──────┘ Evening │ Night │
├──────────────────────────────┼──────────────────────────────┼──────────────────────────────┼──────────────────────────────┤
│ \ / Partly cloudy │ Overcast │ \ / Clear │ \ / Clear │
│ _ /"".-. 5 – 8 °C │ .--. 11 – 13 °C │ .-. 16 – 17 °C │ .-. 13 °C │
│ \_( ). ↙ 13 – 24 km/h │ .-( ). ↙ 15 – 20 km/h │ ― ( ) ― ↙ 11 – 14 km/h │ ― ( ) ― ↙ 15 – 24 km/h │
│ /(___(__) 10 km │ (___.__)__) 10 km │ `-’ 10 km │ `-’ 10 km │
│ 0.0 mm | 0% │ 0.0 mm | 0% │ / \ 0.0 mm | 0% │ / \ 0.0 mm | 0% │
└──────────────────────────────┴──────────────────────────────┴──────────────────────────────┴──────────────────────────────┘
 ┌─────────────┐ 
┌──────────────────────────────┬───────────────────────┤ Tue 27. Dec ├───────────────────────┬──────────────────────────────┐
│ Morning │ Noon └──────┬──────┘ Evening │ Night │
├──────────────────────────────┼──────────────────────────────┼──────────────────────────────┼──────────────────────────────┤
│ \ / Sunny │ \ / Sunny │ \ / Clear │ Mist │
│ .-. 9 – 10 °C │ .-. 14 – 15 °C │ .-. 16 °C │ _ - _ - _ - 14 °C │
│ ― ( ) ― ↙ 8 – 11 km/h │ ― ( ) ― ↙ 9 – 13 km/h │ ― ( ) ― ↙ 9 – 14 km/h │ _ - _ - _ ↙ 10 – 18 km/h │
│ `-’ 10 km │ `-’ 10 km │ `-’ 10 km │ _ - _ - _ - 7 km │
│ / \ 0.0 mm | 0% │ / \ 0.0 mm | 0% │ / \ 0.0 mm | 0% │ 0.0 mm | 0% │
└──────────────────────────────┴──────────────────────────────┴──────────────────────────────┴──────────────────────────────┘
 ┌─────────────┐ 
┌──────────────────────────────┬───────────────────────┤ Wed 28. Dec ├───────────────────────┬──────────────────────────────┐
│ Morning │ Noon └──────┬──────┘ Evening │ Night │
├──────────────────────────────┼──────────────────────────────┼──────────────────────────────┼──────────────────────────────┤
│ \ / Sunny │ \ / Partly cloudy │ Overcast │ Overcast │
│ .-. 13 – 14 °C │ _ /"".-. 20 °C │ .--. 18 °C │ .--. 15 °C │
│ ― ( ) ― ↙ 7 – 10 km/h │ \_( ). ↙ 7 – 9 km/h │ .-( ). ↙ 6 – 13 km/h │ .-( ). ↙ 12 – 26 km/h │
│ `-’ 10 km │ /(___(__) 10 km │ (___.__)__) 10 km │ (___.__)__) 10 km │
│ / \ 0.0 mm | 0% │ 0.0 mm | 0% │ 0.0 mm | 0% │ 0.0 mm | 0% │
└──────────────────────────────┴──────────────────────────────┴──────────────────────────────┴──────────────────────────────┘

Check new Feature: wttr.in/Moon or wttr.in/Moon@2016-Mar-23 to see the phase of the Moon
Follow @igor_chubin for wttr.in updates

As you see in the above output, ostechnix.com is located in Brea city, United States of America, hence the above command displays weather details of Brea city. You can also use IP address instead of domain.

Display weather details using Airport code

I know a particular Airport code. Can I able to get the weather details of that region? Yes!! For example, New Delhi Indira Gandhi International Airport code is DEL.

To display the weather details, just run:

curl wttr.in/DEL

Sample output:

Weather for IATA: del, Indira Gandhi International Airport, India

Smoke
 .--. 22 – 24 °C 
 .-( ). ↘ 11 km/h 
 (___.__)__) 1 km 
 0.0 mm 
 ┌─────────────┐ 
┌──────────────────────────────┬───────────────────────┤ Tue 27. Dec ├───────────────────────┬──────────────────────────────┐
│ Morning │ Noon └──────┬──────┘ Evening │ Night │
├──────────────────────────────┼──────────────────────────────┼──────────────────────────────┼──────────────────────────────┤
│ \ / Sunny │ \ / Sunny │ \ / Clear │ \ / Clear │
│ .-. 20 °C │ .-. 24 – 26 °C │ .-. 22 – 23 °C │ .-. 20 °C │
│ ― ( ) ― → 11 – 13 km/h │ ― ( ) ― → 12 – 14 km/h │ ― ( ) ― → 8 – 11 km/h │ ― ( ) ― → 8 – 14 km/h │
│ `-’ 10 km │ `-’ 10 km │ `-’ 10 km │ `-’ 10 km │
│ / \ 0.0 mm | 0% │ / \ 0.0 mm | 0% │ / \ 0.0 mm | 0% │ / \ 0.0 mm | 0% │
└──────────────────────────────┴──────────────────────────────┴──────────────────────────────┴──────────────────────────────┘
 ┌─────────────┐ 
┌──────────────────────────────┬───────────────────────┤ Wed 28. Dec ├───────────────────────┬──────────────────────────────┐
│ Morning │ Noon └──────┬──────┘ Evening │ Night │
├──────────────────────────────┼──────────────────────────────┼──────────────────────────────┼──────────────────────────────┤
│ \ / Sunny │ \ / Sunny │ \ / Clear │ \ / Clear │
│ .-. 21 – 22 °C │ .-. 25 – 27 °C │ .-. 21 °C │ .-. 18 °C │
│ ― ( ) ― → 9 – 10 km/h │ ― ( ) ― → 12 – 13 km/h │ ― ( ) ― ↗ 9 – 17 km/h │ ― ( ) ― → 9 – 19 km/h │
│ `-’ 10 km │ `-’ 10 km │ `-’ 10 km │ `-’ 10 km │
│ / \ 0.0 mm | 0% │ / \ 0.0 mm | 0% │ / \ 0.0 mm | 0% │ / \ 0.0 mm | 0% │
└──────────────────────────────┴──────────────────────────────┴──────────────────────────────┴──────────────────────────────┘
 ┌─────────────┐ 
┌──────────────────────────────┬───────────────────────┤ Thu 29. Dec ├───────────────────────┬──────────────────────────────┐
│ Morning │ Noon └──────┬──────┘ Evening │ Night │
├──────────────────────────────┼──────────────────────────────┼──────────────────────────────┼──────────────────────────────┤
│ \ / Sunny │ \ / Sunny │ Cloudy │ Overcast │
│ .-. 20 °C │ .-. 25 – 26 °C │ .--. 18 °C │ .--. 14 °C │
│ ― ( ) ― → 4 – 7 km/h │ ― ( ) ― → 3 – 4 km/h │ .-( ). ↗ 2 – 5 km/h │ .-( ). ← 5 – 10 km/h │
│ `-’ 10 km │ `-’ 10 km │ (___.__)__) 10 km │ (___.__)__) 10 km │
│ / \ 0.0 mm | 0% │ / \ 0.0 mm | 0% │ 0.0 mm | 0% │ 0.0 mm | 0% │
└──────────────────────────────┴──────────────────────────────┴──────────────────────────────┴──────────────────────────────┘

Check new Feature: wttr.in/Moon or wttr.in/Moon@2016-Mar-23 to see the phase of the Moon
Follow @igor_chubin for wttr.in updates

Display weather details using Zipcode

It is also possible to get weather details if you know any region’s zipcode. For example, New York are a code is 10001. So, just run the following command to display the weather information of New York city.

curl wttr.in/10001

Display weather details in a web browser

Can I get the same details in a web browser? Of course! Open up your web browser, and navigate to http://wttr.in/ in the address bar.

The developer has added a new feature to display the phase of moon.

curl wttr.in/moon

Or,

curl wttr.in/Moon@2016-Mar-23

To display the help section of wttr.in utility, run:

curl wttr.in/:help

This is the easiest method ever I have found to display the weather details of any location. Have you tried this utility? What do you think about it? Do you know any best alternatives? Great! Feel free to let us know in the comment section below.

Cheers!

Resource:

Thanks for stopping by!

How can I benefit from this blog:

Have a Good day!!

You may also like...