Retrieve Weather information using Linux command line

Whether you are stubborn command line user or you wish to automate flower watering using your Linux system and cron, the inxi tool is here to accommodate your needs. Apart of a current outside temperature, inxi allows you to retrieve data such us wind, pressure, humidity, altitude and more directly from your Linux terminal.


inxi is available from a standard package repository on some major Linux systems such as Fedora Linux or Ubuntu. For Debian installation see: Installation of inxi system information script on Debian Wheezy

$ sudo apt-get install inxi
$ sudo yum install inxi

Retrieve Local Weather information

The following linux command will retrieve your local weather information. The local weather information is based on your localtime settings:

$ ls -l /etc/localtime
lrwxrwxrwx. 1 root root 38 Jun 11 13:08 /etc/localtime -> ../usr/share/zoneinfo/Australia/Sydney

The issuing inxi command without any arguments will fetch current weather information for Sydney, Australia:

$ inxi -w
Weather:   Conditions: 53 F (12 C) - Clear Time: June 25, 11:49 AM CST

To get more information such as pressure or humidity from the inxi’s command output simply include -xxx option:

$ inxi -xxxw
Weather:   Conditions: 53 F (12 C) - Clear Wind: From the West at 2 MPH Humidity: 66%
           Pressure: 30.35 in (1028 mb) Location: None None (AUS) Altitude: 324 ft 
           Time: June 25, 11:51 AM CST (None) Observation Time: June 24, 9:00 AM CST

Retrieve Remote Weather information

With -W command line options inxi is also capable to retrieve weather information from any other remote location around the world. The arguments to -W option should be in city,state OR latitude,longitude OR postal/zip code format. For example let’s retrieve Warsaw,Poland weather information:

$ inxi -W Warsaw,Poland
Weather:   Conditions: 48 F (9 C) - shallow fog Time: June 25, 4:30 AM CEST

Do not fear if your location is not included as part tzdata data. inxi is able to retrieve information from the closest weather information point based on latitude,longitude:

$ inxi -xxxW 23.545988,8.853559
Weather:   Conditions: 79 F (26 C) - Clear Wind: From the West at 9 MPH Humidity: 17%
           Pressure: 30.15 in (1021 mb) Location: Djanet (AL) Altitude: 967 ft 
           Time: June 25, 3:38 AM CET Observation Time: June 24, 11:00 AM CET