无法使用 wget 下载文件
Cannot to download a file using wget
我无法使用 wget 下载文件,但如果我将此 link 放入 Safari,它会成功下载。那个问题的原因是什么?
Andreys-MacBook-Pro:currentFolder kleverigheid$ wget http://nomads.ncep.noaa.gov/cgi-bin/filter_gfs_0p25.pl?file=gfs.t06z.pgrb2.0p25.f000&all_lev=on&all_var=on&subregion=&leftlon=22&rightlon=42&toplat=53&bottomlat=45&dir=/gfs.2015070506
[1] 70728
[2] 70729
[3] 70730
[4] 70731
[5] 70732
[6] 70733
[7] 70734
[2] Done all_lev=on
[3] Done all_var=on
[4] Done subregion=
[5] Done leftlon=22
[6]- Done rightlon=42
[7]+ Done toplat=53
Andreys-MacBook-Pro:currentFolder kleverigheid$ --2015-07-05 15:02:05-- http://nomads.ncep.noaa.gov/cgi-bin/filter_gfs_0p25.pl?file=gfs.t06z.pgrb2.0p25.f000
Resolving nomads.ncep.noaa.gov... 140.90.101.62
Connecting to nomads.ncep.noaa.gov|140.90.101.62|:80... connected.
HTTP request sent, awaiting response... 404 data file not present
2015-07-05 15:02:06 ERROR 404: data file not present.
Andreys-MacBook-Pro:currentFolder kleverigheid$
shell - 不是 wget - 将 &
解释为特殊字符,指示 运行 后台程序。为避免这种情况,只需将整个 URL 放在引号中,如下所示:
$ wget 'http://nomads.ncep.noaa.gov/cgi-bin/filter_gfs_0p25.pl?file=gfs.t06z.pgrb2.0p25.f000&all_lev=on&all_var=on&subregion=&leftlon=22&rightlon=42&toplat=53&bottomlat=45&dir=/gfs.2015070506'
我无法使用 wget 下载文件,但如果我将此 link 放入 Safari,它会成功下载。那个问题的原因是什么?
Andreys-MacBook-Pro:currentFolder kleverigheid$ wget http://nomads.ncep.noaa.gov/cgi-bin/filter_gfs_0p25.pl?file=gfs.t06z.pgrb2.0p25.f000&all_lev=on&all_var=on&subregion=&leftlon=22&rightlon=42&toplat=53&bottomlat=45&dir=/gfs.2015070506
[1] 70728
[2] 70729
[3] 70730
[4] 70731
[5] 70732
[6] 70733
[7] 70734
[2] Done all_lev=on
[3] Done all_var=on
[4] Done subregion=
[5] Done leftlon=22
[6]- Done rightlon=42
[7]+ Done toplat=53
Andreys-MacBook-Pro:currentFolder kleverigheid$ --2015-07-05 15:02:05-- http://nomads.ncep.noaa.gov/cgi-bin/filter_gfs_0p25.pl?file=gfs.t06z.pgrb2.0p25.f000
Resolving nomads.ncep.noaa.gov... 140.90.101.62
Connecting to nomads.ncep.noaa.gov|140.90.101.62|:80... connected.
HTTP request sent, awaiting response... 404 data file not present
2015-07-05 15:02:06 ERROR 404: data file not present.
Andreys-MacBook-Pro:currentFolder kleverigheid$
shell - 不是 wget - 将 &
解释为特殊字符,指示 运行 后台程序。为避免这种情况,只需将整个 URL 放在引号中,如下所示:
$ wget 'http://nomads.ncep.noaa.gov/cgi-bin/filter_gfs_0p25.pl?file=gfs.t06z.pgrb2.0p25.f000&all_lev=on&all_var=on&subregion=&leftlon=22&rightlon=42&toplat=53&bottomlat=45&dir=/gfs.2015070506'