Sorry, your browser cannot access this site
This page requires browser support (enable) JavaScript
Learn more >

Mac关闭指定端口

先执行如下命令

1
lsof -i:端口号

会有类似下面的结果:
image.png
然后执行:

1
kill -9 42624

结束进程就搞定了

Mac 终端开启和关闭代理的方法

假如你的代理机是你的本机(127.0.0.1),代理的端口为 7070,

开启代理很简单,就是用 export 命令设置全局变量 http_proxy 和 https_proxy:

1
2
export http_proxy="http://127.0.0.1:7070"
export https_proxy="http://127.0.0.1:7070"

关闭代理就是用 unset 命令把全局变量清空:

$ unset http_proxy

$ unset ftp_proxy

$ unset all_proxy

$ unset https_proxy

$ unset no_proxy

查看是否还存在代理

1
env | grep -i proxy

ps : 清空代理需要重新打开 terminal

评论