常用Linux命令

  1. 服务器查看端口

    netstat -tunlp | grep 端口号
    
  2. git 设置代理

    # socks
    git config --global http.proxy 'socks5://127.0.0.1:1080' 
    git config --global https.proxy 'socks5://127.0.0.1:1080'
    # http
    git config --global http.proxy http://127.0.0.1:1080 
    git config --global https.proxy https://127.0.0.1:1080
    
    # 只对github.com使用代理,其他仓库不走代理
    git config --global http.https://github.com.proxy socks5://127.0.0.1:1080
    git config --global https.https://github.com.proxy socks5://127.0.0.1:1080
    # 取消github代理
    git config --global --unset http.https://github.com.proxy
    git config --global --unset https.https://github.com.proxy