How to get the weather forecast for your US postcode using the weather command.

Getting the weather forecast for your US postcode is very simple when you are running either Ubuntu or Linux Mint. The weather-util package contains the weather command that makes this possible.

Use this command to install the weather-util package.


sudo apt-get install weather-util

This is the output that you get when you use the weather command to find the forecast for the 90210 postcode.

bash 10:22:35 Fri Jul 12 [[email protected] $ weather 90210
Searching via ZCTA...
Current conditions at Santa Monica Municipal Airport , CA
Last updated Jul 11, 2013 - 07:51 PM EDT / 2013.07.11 2351 UTC
   Temperature: 71.1 F (21.7 C)
   Relative Humidity: 75%
   Wind: from the WSW (240 degrees) at 5 MPH (4 KT)
   Sky conditions: clear

And here is the weather ATM in Central Park New York, 10021. This command could be inserted into your .bashrc or .bash_profile so that it displayed the weather every time you open a terminal emulator window. Very useful indeed.

bash 10:31:14 Fri Jul 12 [[email protected] $ weather 10021
Searching via ZCTA...
Current conditions at New York City Central Park, NY
Last updated Jul 11, 2013 - 07:51 PM EDT / 2013.07.11 2351 UTC
   Temperature: 82.0 F (27.8 C)
   Relative Humidity: 47%
   Wind: Variable at 5 MPH (4 KT)
   Sky conditions: clear

This weather command seems to only work for postcodes within the United States, but if that is your location, then you will find this very useful indeed.

No comments have been made. Use this form to start the conversation :)

Leave a Reply