Linux命令行开启代理
· ☕ 3 分钟 · 🐵 chenyanggao

背景
我们在 Linux 命令行中,经常会需要使用代理(参考:How To Use Proxy Server To Access Internet at Shell Prompt With http_proxy Variable,Linux Proxy Server Settings – Set Proxy For Command Line),以便能访问某些资源。
为了便于做到这一点,我以自己的偏好出发,编写了一个 shell 脚本,已经在 bash 和 zsh 中通过测试。