mac 如何查看本机80端口被占用了
Mac下使用这个命令即可查看所有占用的端口
sudo lsof -i -P | grep -i "listen"
关于Linux如何查看端口,可以参考这篇文章。http://droidyue.com/blog/2013/09/25/list-ports-on-linux/
查看端口被那个进程占用:lsof -P | grep ':80' | awk '{print $2}'执行结果是:pid
然后根据pid查看进程信息localhost:~ whuanghkl$ ps -ef |grep 378501 378 1 0 8:52AM ?? 0:00.64 /Applications/ShadowsocksX.app/Contents/MacOS/ShadowsocksX
If you are going to find the process listening on 80 port:
80
lsof -iTCP:80 | grep LISTEN
lsof -n -i4TCP:80 | grep LISTEN
谢谢各位了。。。。。。
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
暂无简介
文章 0 评论 0
接受
发布评论
评论(5)
Mac下使用这个命令即可查看所有占用的端口
关于Linux如何查看端口,可以参考这篇文章。http://droidyue.com/blog/2013/09/25/list-ports-on-linux/
查看端口被那个进程占用:
lsof -P | grep ':80' | awk '{print $2}'
执行结果是:pid
然后根据pid查看进程信息
localhost:~ whuanghkl$ ps -ef |grep 378
501 378 1 0 8:52AM ?? 0:00.64 /Applications/ShadowsocksX.app/Contents/MacOS/ShadowsocksX
If you are going to find the process listening on
80
port:lsof -n -i4TCP:80 | grep LISTEN
谢谢各位了。。。。。。