Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

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 14 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

Simply enter the following in a terminal:


For example, for Tehran:


Which gives you:

Sample output

share|improve this answer
Way much better ! – Stuffix May 13 at 21:33

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
This is being publicly hosted now - with IP address to region mapping. Try: curl -4 – jschrab Feb 24 at 21:56
@jschrab: And you don't need -4 actually. curl is enough – Igor Chubin Feb 24 at 22:25

Try using

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
I just tried this and discovered that it is easier to use now: weather YOURLOCATIONNAME It searches for your location then and provides possibly multiple results. From these you can read the station identifier which you can use as argument to fetch your weather informations from – Nicolas Mar 22 at 23:05

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.