在~/.zshrc或者~/.bashrc中添加如下两行 alias poff="unset http_proxy; unset https_proxy"alias pon="export http_proxy=http://127.0.0.1:1087;export https_proxy=http://127.0.0.1:1087" pon是开启代理,poff是关闭代理 打开一个命令行窗口: 开启代理前测一下 开启代理后测测