Linux command
yr 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Show current weather
yr
Show 5-day forecast
yr -f
Show tomorrow's weather at noon
yr -d 1 -h 12
说明
yr is a command-line tool that fetches weather data from the yr.no API (Meteorologisk institutt) and OpenStreetMap's Nominatim API. It outputs forecasts in JSON format and supports querying specific hours and multi-day forecasts via a configuration file. A configuration file (typically under `~/.config/yr/`) stores the default location, units, and language so simple queries can be made without arguments.
参数
- -f, --forecast
- Show a multi-day forecast instead of the current weather.
- -d _DAYS_
- Forecast offset in days from today (0 = today, 1 = tomorrow).
- -h _HOUR_
- Forecast hour of the day (0-23).
- -l _LOCATION_
- Override the configured location for this query.
- --help
- Display help information.
FAQ
What is the yr command used for?
yr is a command-line tool that fetches weather data from the yr.no API (Meteorologisk institutt) and OpenStreetMap's Nominatim API. It outputs forecasts in JSON format and supports querying specific hours and multi-day forecasts via a configuration file. A configuration file (typically under `~/.config/yr/`) stores the default location, units, and language so simple queries can be made without arguments.
How do I run a basic yr example?
Run `yr` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -f, --forecast do in yr?
Show a multi-day forecast instead of the current weather.