MAC查看网络端口、进程使用情况

# 查看所有TCP连接
lsof -nP -iTCP
# 查看所有TCP中的LISTEN连接
lsof -nP -iTCP -sTCP:LISTEN
# 查看某个进程的所有网络状态
lsof -nP -p 进程号

# 查看所有TCP连接
lsof -nPitcp
# 查看所有IPv4连接
lsof -nPi4
# 查看所有网络连接
netstat -an
# 查看所有TCP连接
netstat -anptcp
原文地址:https://www.cnblogs.com/stono/p/14401749.html