为wget命令设置代理
为wget命令设置代理 实验环境:ubuntu 12.04 LTS goagent 方法一、在环境变量中设置代理 export http_proxy=http://127.0.0.1:8087 方法二、使用配置文件 为wget使用代理,可以直接修改/etc/wgetrc,也可以在主文件夹下新建.wgetrc,并编辑相应内容,本文采用后者。 将/etc/wgetrc中与proxy有关的几行复制到~/.wgetrc,并做如下修改: #You can set the default proxies for Wget to use for http, https, and ftp. # They will override the value in the environment. https_proxy = http://127.0.0.1:8087/ http_proxy = http://127.0.0.1:8087/ ftp_proxy = http://127.0.0.1:8087/ # If you do not want to use proxy at all, set this to off. use_proxy = on 这里 use_proxy = on 开启了代理,如果不想使用代理,每次都修改此文件未免麻烦,我们可以在命令中使用-Y参数来临时设置: -Y, -