2015-07-05 215 views
1

我無法使用wget下載文件,但是如果我將此鏈接放入Safari,它會成功下載。這個問題的原因是什麼?無法使用wget下載文件

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$ 

回答

0

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' 
+0

Thanks!這幫助了我! – kleverigheid