> For the complete documentation index, see [llms.txt](https://close.gitbook.io/yun-wei-bi-ji/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://close.gitbook.io/yun-wei-bi-ji/centos/linux-ji-cao/linux-zhong-duan-dai-li.md).

# Linux-终端代理

**方法一：（推荐使用）**

```bash
# http、https、socks5 协议
export http_proxy="http://proxyAddress:port"
export https_proxy="http://proxyAddress:port"

export http_proxy="socks5://proxyAddress:port"
export https_proxy="socks5://proxyAddress:port"

# 可以使用所有流量走代理
export ALL_PROXY=http://proxyAddress:port
export ALL_PROXY=http://proxyAddress:port
```

**方法二：**

```bash
# ~/.bashrc  ，经常使用的话可以使用
 alias setproxy="export ALL_PROXY=socks5://proxyAddress:port" alias unsetproxy="unset ALL_PROXY"
```

**如果说经常使用git对于其他方面都不是经常使用，可以直接配置git的命令。**

```bash
git config --global http.proxy 'socks5://127.0.0.1:1080' 
git config --global https.proxy 'socks5://127.0.0.1:1080'
```
