Friday, April 19, 2024
185
rated 0 times [  185] [ 0]  / answers: 1 / hits: 134188  / 2 Years ago, sat, march 12, 2022, 12:10:13

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


More From » command-line

 Answers
0

Simply enter the following in a terminal:



curl wttr.in


And will get your location from /etc/timezone. Otherwise curl wttr.in/your_location. For example, for Tehran:



curl wttr.in/tehran


Which gives you:



Sample output



You can also compare two cities:



diff -Naur <(curl -s http://wttr.in/london ) <(curl -s http://wttr.in/new-york )


Source code of developer is available on Github.


[#27989] Saturday, March 12, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
girdleas

Total Points: 1
Total Questions: 112
Total Answers: 114

Location: Lesotho
Member since Wed, Jun 2, 2021
3 Years ago
girdleas questions
;