How to get weather details in Command Prompt, macOS or Linux Terminal

If you are a developer or a DevOps person working most of the time on command line interfaces (CLIs) such as Windows Command Prompt, or on Linux or macOS Terminals, and want to know how to get weather details of your city (or any city around the world) displayed using a command in console, here is how you can do it with a simple curl command to a website that provides a response in a very colourful and intuitive way.

Example: $ curl
Weather details using command line
Weather details using command line

✌️You can also create aliases for the curl so that instead of tying it always you can remember something a shortcut like temp: check out how - Custom Aliases Examples

Recent Posts:
Code2care is an initiative to publish and share varied knowledge in programming and technical areas gathered during day-to-day learnings and development activities.

Students and Software Developers can leverage this portal to find solutions to their various queries without re-inventing the wheel by referring to our easy to understand posts. Technical posts might include Learnings, Video Tutorials, Code Snippets, How Tos, Blogs, Articles, etc.