Get Your Weather Forecast From the Linux CLI


Display the current weather forecast in the Linux command line.


This will work on any Linux distribution.


A working Linux install with an Internet connection.




  • # – requires given linux commands to be executed with root privileges either directly as a root user or by use of sudo command
  • $ – requires given linux commands to be executed as a regular non-privileged user


It’s be convenient to be able to retrieve the latest weather forecast right from your terminal without opening up a web browser, wouldn’t it? What about scripting it or setting a cron job? Well, you can. is a website that allows you to search for weather forecasts anywhere in the world, and it displays he results in ASCII characters. By using cURL, you can access, you can get your results directly in the terminal.

Get Your Local Weather

Local weather from

It’s really simple to grab your local weather. will automatically try to detect your location based on your IP address. It’s reasonably accurate, unless you’re using a VPN, of course.

$ curl

Get Weather By City

Weather by city from

Now, if you would like the weather in a different city, you can specify that with a slash at the end of Replace any spaces in the name with a +.

$ curl

You can also specify cities the way they’re written in Unix timezones.

$ curl

Don’t use spaces unless you like strange and inaccurate results.

Get Weather By Airport

Weather by airport from

If you’re familiar with the three letter airport codes in your area, you can use those too. They might be closer to you and more accurate than the city in general.

$ curl

Best Guess

Weather by landmark from

You can have take a guess on the weather base on a landmark using the ~ character.

$ curl

Weather From A Domain Name

Weather by domain name from

Did you ever wonder what the weather is like where LinuxConfig is hosted? Now, now you can find out! can check weather by domain name. Sure, it’s probably not the most useful feature, but it’s still interesting none the less.

$ curl

Changing The Temperature Units

Change unit system in

By default, will display temperatures in the units(C or F) used in your actual location. Basically, in States, you’ll get Fahrenheit, and everyone else will see Celsius. You can change that by adding ?u to see Fahrenheit or ?m to see Celsius.

$ curl

$ curl

There’s an odd bug with ZSH that prevents this from working, so you need to use Bash if you want to convert the units.

Closing Thoughts

You can easily incorporate a call to into a script, cron job, or even your MOTD. Of course, you don’t need to get that involved. You can just lazily type a call in to this awesome service whenever you want to check the forecast.

Comments and Discussions
Linux Forum