mac查看当前调用tcp的进程并关闭指定进程:
一)查看本机macbook打开的端口:
lsof -iTCP -sTCP:LISTEN
MotionPro 2766 jackXiang 16u IPv4 0xc8299b5de6c3cc43 0t0 TCP localhost:60012 (LISTEN)
Adobe\x20 2858 jackXiang 13u IPv4 0xc8299b5dea54da73 0t0 TCP localhost:15292 (LISTEN)
com.docke 2890 jackXiang 8u IPv4 0xc8299b5dea125b5b 0t0 TCP localhost:56199 (LISTEN)
phpstorm 2918 jackXiang 186u IPv4 0xc8299b5dea91527b 0t0 TCP localhost:6942 (LISTEN)
phpstorm 2918 jackXiang 362u IPv4 0xc8299b5deaa2a8b3 0t0 TCP localhost:63342 (LISTEN)
二)查看连接远程端口:
lsof -iTCP -dTCP:LISTEN
lsof -iTCP -dTCP:LISTEN|grep Google #查看google浏览器连接的端口
safara进程:
/System/Library/Frameworks/WebKit.framework/Versions/A/XPCServices/com.apple.WebKit.WebContent.xpc/Contents/MacOS/com.apple.WebKit.WebContent
502 57037 1 0 11:42上午 ?? 0:06.24 /System/Library/Frameworks/WebKit.framework/Versions/A/XPCServices/com.apple.WebKit.WebContent.xpc/Contents/MacOS/com.apple.WebKit.WebContent
一)查看本机macbook打开的端口:
lsof -iTCP -sTCP:LISTEN
MotionPro 2766 jackXiang 16u IPv4 0xc8299b5de6c3cc43 0t0 TCP localhost:60012 (LISTEN)
Adobe\x20 2858 jackXiang 13u IPv4 0xc8299b5dea54da73 0t0 TCP localhost:15292 (LISTEN)
com.docke 2890 jackXiang 8u IPv4 0xc8299b5dea125b5b 0t0 TCP localhost:56199 (LISTEN)
phpstorm 2918 jackXiang 186u IPv4 0xc8299b5dea91527b 0t0 TCP localhost:6942 (LISTEN)
phpstorm 2918 jackXiang 362u IPv4 0xc8299b5deaa2a8b3 0t0 TCP localhost:63342 (LISTEN)
二)查看连接远程端口:
lsof -iTCP -dTCP:LISTEN
lsof -iTCP -dTCP:LISTEN|grep Google #查看google浏览器连接的端口
safara进程:
/System/Library/Frameworks/WebKit.framework/Versions/A/XPCServices/com.apple.WebKit.WebContent.xpc/Contents/MacOS/com.apple.WebKit.WebContent
502 57037 1 0 11:42上午 ?? 0:06.24 /System/Library/Frameworks/WebKit.framework/Versions/A/XPCServices/com.apple.WebKit.WebContent.xpc/Contents/MacOS/com.apple.WebKit.WebContent
作者:jackxiang@向东博客 专注WEB应用 构架之美 --- 构架之美,在于尽态极妍 | 应用之美,在于药到病除
地址:https://jackxiang.com/post/10422/
版权所有。转载时必须以链接形式注明作者和原始出处及本声明!
评论列表