Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to find the current weather of a particular city or my location from terminal.Is there any command-line weather app?

share|improve this question
up vote 10 down vote accepted

Search for your city at and replace the URL in the following script with the URL for your city:



wget -q -O- "$URL" | awk -F\' '/acm_RecentLocationsCarousel\.push/{print $2": "$16", "$12"°" }'| head -1

Sample output:

Berlin, Germany: Foggy, 1°
share|improve this answer

I have got one more way .

Open your .bashrc file and then paste this code at the bottom

weather(){ curl -s "${@:-<YOURZIPORLOCATION>}"|perl -ne '/<title>([^<]+)/&&printf "%s: ",$1;/<fcttext>([^<]+)/&&print $1,"\n"';}

Then save & close your .bashrc file.

now type bash to update the file.

then type

weather <location name>

for example

august@august-OEM:~$ weather guntur
December 14, 2013: Clear. High 31&amp;deg;C (87&amp;deg;F). Winds 0 kph North
December 15, 2013: Clear. High 29&amp;deg;C (84&amp;deg;F). Winds 10 kph NNW
December 16, 2013: Clear. High 31&amp;deg;C (87&amp;deg;F). Winds 10 kph North
December 17, 2013: Clear. High 29&amp;deg;C (84&amp;deg;F). Winds 7 kph ENE
December 18, 2013: Scattered Clouds. High 29&amp;deg;C (84&amp;deg;F). Winds 3 kph ENE
December 19, 2013: Scattered Clouds. High 29&amp;deg;C (84&amp;deg;F). Winds 3 kph ENE
share|improve this answer
Nice with weather forecast. +1 from me. – souravc Dec 15 '13 at 5:48

Here's a great semi-graphical command line utility written in Go:

You'll need to install Go and setup some API stuff, but the instructions are there. Here's a sample pic:

enter image description here

share|improve this answer

First you need to install the weather-util package, to do that just press Ctrl+Alt+T on your keyboard to open Terminal. When it opens, run the command(s) below:

sudo apt-get install weather-util

You’ll need your local weather code.

After installation you can run weather -i <code>. The code you get from the link above. For a list of available options, you can run weatherWeather info

share|improve this answer
it shows Last updated Dec 11, 2013 - 07:00 AM EST / 2013.12.11 1200 UTC Temperature: 86 F (30 C).is there no way to know the current weather. – Avinash Raj Dec 13 '13 at 17:13
Depending on your location that could be the current info that's available. – Mitch Dec 13 '13 at 17:15

Although accuweather curl solution is pretty good I needed something more informational, so I created simple bash script that pulls info for next 4 hrs from website. As in previous example you have to modify link for your location.

Example output:
$ ./
Temperature for 1 AM : 65&deg;F and outside should be: Partly - Cloudy FEELS LIKE:   65&deg;
Temperature for 2 AM : 65deg;F and outside should be: Partly - Cloudy FEELS LIKE: 65deg;
Temperature for 3 AM : 63deg; and outside should be: Partly - Cloudy FEELS LIKE: 63deg;
Temperature for 4 AM : 62deg; and should be: Mostly - Clear FEELS LIKE: 62deg;

Full script is located at:

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.