mac上如何查看某端口号被哪些程序占用?

2012-10-22 16:50:35 +08:00
 cuijiudai
比如127.0.0.1:8087,如何查看哪个进程占用了8087
76098 次点击
所在节点    macOS
6 条回复
yangg
2012-10-22 16:53:16 +08:00
lsof -i :80
bearice
2012-10-22 17:02:01 +08:00
sudo lsof -n -P| grep :8087
gavingeng
2012-10-23 00:29:14 +08:00
nc -v -w 2 127.0.0.1 8087
leecade
2012-10-23 01:34:11 +08:00
lsof -i tcp:8087
leecade
2012-10-23 01:42:52 +08:00
better 在 bash 自定义下

# belongs to port
# usage: "port 8000"
function port() { lsof -i tcp:$1 }

# all open ports
# usage: "ports"
function ports() { lsof -Pni4 | grep LISTEN }
xiaket
2012-10-23 14:16:48 +08:00
[xiaket@rondo:~]alias nettop
alias nettop='nettop -nm tcp'

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/50603

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX