Skip to main content Link Search Menu Expand Document (external link)

因为终端和命令提示符很多操作时通用的所以整理到一起了,如果同一操作有不同之处会注明。

终端启动方法

  • cmd + 空格键 启动聚焦搜索,输入终端;

命令提示符启动方法

  • Win + R
  • 资源管理器中按住 Shift 在文件夹上点击右键;

切换到 root 用户(进入管理员模式)

sudo su

终端命令符走代理(只支持 MacOS)

正常情况终端和命令提示符在电脑使用全局代理时,依旧不会走代理,这个时候就需要手动启用。具体的代理协议和地址、端口请填写自己用代理的具体参数。

临时走代理

代理ip和端口请对应电脑配置修改

全部代理

export ALL_PROXY=socks5://127.0.0.1:1080

指定 http 和 https 代理

export http_proxy=socks5://127.0.0.1:1080
export https_proxy=socks5://127.0.0.1:1080

Git环境走代理

1080 端口请修改为你代理配置的端口

socks5 全局

git config –global http.proxy 'socks5://127.0.0.1:1080'
git config –global https.proxy 'socks5://127.0.0.1:1080'

socks5 非全局

git config http.proxy 'socks5://127.0.0.1:1080'
git config https.proxy 'socks5://127.0.0.1:1080'

Git 取消代理

git config --global --unset http.proxy
git config --global --unset https.proxy

非全局

git config --unset http.proxy
git config --unset https.proxy

参考:

  • https://blog.csdn.net/talkxin/article/details/97887121
  • https://www.cnblogs.com/sunsky303/p/8024445.html
  • https://www.cnblogs.com/xueweihan/p/7242577.html

查IP

通过 curl 查当前终端IP状态(网络是否走代理)

英文版

curl ipinfo.io

中文版

curl cip.cc

通过 curl 查看当前公网IP

备用

curl ifconfig.me

备用

curl ipinfo.io/json

备用

wget http://ipecho.net/plain -O - -q ; echo

回到顶部

Copyright © 2017-2023 1px.run (像素指南) Distributed by an MIT license.