{"id":90462,"date":"2024-03-06T17:46:12","date_gmt":"2024-03-06T09:46:12","guid":{"rendered":"http:\/\/gulass.cn\/?p=90462"},"modified":"2024-03-06T17:46:12","modified_gmt":"2024-03-06T09:46:12","slug":"linux-netstat","status":"publish","type":"post","link":"https:\/\/gulass.cn\/linux-netstat.html","title":{"rendered":"Linux\u4e0b netstat\u7684\u4f7f\u7528"},"content":{"rendered":"
\u5bfc\u8bfb<\/td>\n | netstat \u662f\u4e00\u4e2a\u544a\u8bc9\u6211\u4eec\u7cfb\u7edf\u4e2d\u6240\u6709 tcp\/udp\/unix socket \u8fde\u63a5\u72b6\u6001\u7684\u547d\u4ee4\u884c\u5de5\u5177\u3002\u5b83\u4f1a\u5217\u51fa\u6240\u6709\u5df2\u7ecf\u8fde\u63a5\u6216\u8005\u7b49\u5f85\u8fde\u63a5\u72b6\u6001\u7684\u8fde\u63a5\u3002 \u8be5\u5de5\u5177\u5728\u8bc6\u522b\u67d0\u4e2a\u5e94\u7528\u76d1\u542c\u54ea\u4e2a\u7aef\u53e3\u65f6\u7279\u522b\u6709\u7528\uff0c\u6211\u4eec\u4e5f\u80fd\u7528\u5b83\u6765\u5224\u65ad\u67d0\u4e2a\u5e94\u7528\u662f\u5426\u6b63\u5e38\u7684\u5728\u76d1\u542c\u67d0\u4e2a\u7aef\u53e3\u3002<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n <\/p>\n netstat \u547d\u4ee4\u8fd8\u80fd\u663e\u793a\u5176\u5b83\u5404\u79cd\u5404\u6837\u7684\u7f51\u7edc\u76f8\u5173\u4fe1\u606f\uff0c\u4f8b\u5982\u8def\u7531\u8868\uff0c \u7f51\u5361\u7edf\u8ba1\u4fe1\u606f\uff0c \u865a\u5047\u8fde\u63a5\u4ee5\u53ca\u591a\u64ad\u6210\u5458\u7b49\u3002<\/p>\n \u672c\u6587\u4e2d\uff0c\u6211\u4eec\u4f1a\u901a\u8fc7\u51e0\u4e2a\u4f8b\u5b50\u6765\u5b66\u4e60 netstat\u3002<\/p>\n 1 - \u68c0\u67e5\u6240\u6709\u7684\u8fde\u63a5<\/strong><\/div>\n \u4f7f\u7528a \u9009\u9879\u53ef\u4ee5\u5217\u51fa\u7cfb\u7edf\u4e2d\u7684\u6240\u6709\u8fde\u63a5\uff0c \u8fd9\u4f1a\u663e\u793a\u7cfb\u7edf\u6240\u6709\u7684 tcp\u3001udp \u4ee5\u53ca unix \u8fde\u63a5\u3002<\/p>\n \u4f7f\u7528 t\u9009\u9879\u53ea\u5217\u51fa tcp\u00a0\u8fde\u63a5\uff0c \u7c7b\u4f3c\u7684\uff0c\u4f7f\u7528u \u9009\u9879\u53ea\u5217\u51faudp \u00a0\u8fde\u63a5\uff0c \u4f7f\u7528 x\u00a0\u9009\u9879\u53ea\u5217\u51fa Unix socket \u8fde\u63a5\uff0c \u4f7f\u7528 p\u9009\u9879\u53ef\u4ee5\u5728\u5217\u51fa\u8fde\u63a5\u7684\u540c\u65f6\u4e5f\u663e\u793a PID \u6216\u8005\u8fdb\u7a0b\u540d\u79f0\uff0c\u800c\u4e14\u5b83\u8fd8\u80fd\u4e0e\u5176\u4ed6\u9009\u9879\u8fde\u7528\uff0c \u4f7f\u7528 n \u9009\u9879\u53ef\u4ee5\u52a0\u5feb\u8f93\u51fa\uff0c\u5b83\u4e0d\u4f1a\u6267\u884c\u4efb\u4f55\u53cd\u5411\u67e5\u8be2\uff08LCTT \u8bd1\u6ce8\uff1a\u8fd9\u91cc\u539f\u6587\u6709\u8bef\uff09\uff0c\u800c\u662f\u76f4\u63a5\u8f93\u51fa\u6570\u5b57\u3002 \u7531\u4e8e\u65e0\u9700\u67e5\u8be2\uff0c\u56e0\u6b64\u7ed3\u679c\u8f93\u51fa\u4f1a\u5feb\u5f88\u591a\u3002 \u4f7f\u7528l \u9009\u9879\u53ea\u8f93\u51fa\u76d1\u542c\u7aef\u53e3\u3002\u5b83\u4e0d\u80fd\u4e0e a\u00a0\u9009\u9879\u8fde\u7528\uff0c\u56e0\u4e3a a\u00a0\u4f1a\u8f93\u51fa\u6240\u6709\u7aef\u53e3\uff0c \u4f7f\u7528 s\u00a0\u9009\u9879\u8f93\u51fa\u6bcf\u4e2a\u534f\u8bae\u7684\u7edf\u8ba1\u4fe1\u606f\uff0c\u5305\u62ec\u63a5\u6536\/\u53d1\u9001\u7684\u5305\u6570\u91cf\uff0c \u4f7f\u7528 I\u00a0\u9009\u9879\u53ea\u663e\u793a\u7f51\u5361\u7684\u7edf\u8ba1\u4fe1\u606f\uff0c |