linux命令行设置代理

设置本次命令行生效:

1
2
3
4
5
export http_proxy=http://192.168.1.19:8118/
export https_proxy=$http_proxy
export ftp_proxy=$http_proxy
export rsync_proxy=$http_proxy
export no_proxy="localhost,127.0.0.1,localaddress,.localdomain.com"

或者保存在文件中
修改/etc/environment。添加代理:

1
2
​http_proxy="http://localhost:10809"
https_proxy=$http_proxy