linuxÔõô¿´¶Ë¿Ú±»Õ¼ÓÃ
linux ϵͳÖÐÉó²é±»Õ¼ÓõĶ˿ڵÄÒªÁìÓУºÊ¹Óà netstat ÏÂÁnetstat -tulpnʹÓà lsof ÏÂÁlsof -iʹÓà ss ÏÂÁss -tulpanʹÓà fuser ÏÂÁfuser -n tcp
ÔõÑùÉó²é Linux Öб»Õ¼ÓõĶ˿Ú
ÔÚ Linux ϵͳÖУ¬Éó²éÕýÔÚʹÓõĶ˿ÚÓжàÖÖÒªÁ죬ÒÔÏÂÁгöÆäÖÐһЩ£º
1. netstat ÏÂÁî
netstat ÏÂÁî¿ÉÒÔÏÔʾĿ½ñϵͳÉϵÄÍøÂçÅþÁ¬ÐÅÏ¢£¬°üÀ¨¶Ë¿ÚʹÓÃÇéÐΡ£ÒªÉó²é±»Õ¼ÓõĶ˿ڣ¬¿ÉÒÔʹÓÃÒÔÏÂÏÂÁ
netstat -tulpn
µÇ¼ºó¸´ÖÆ
¸ÃÏÂÁÏÔʾËùÓÐÕýÔÚʹÓÃµÄ TCP ºÍ UDP ¶Ë¿Ú£¬ÒÔ¼°ÓµÓÐÕâЩ¶Ë¿ÚµÄÀú³Ì¡£
2. lsof ÏÂÁî
lsof ÏÂÁî¿ÉÒÔÏÔʾĿ½ñϵͳÉÏ·¿ªµÄÎļþºÍÍøÂçÅþÁ¬£¬°üÀ¨¶Ë¿ÚʹÓÃÇéÐΡ£ÒªÉó²é±»Õ¼ÓõĶ˿ڣ¬¿ÉÒÔʹÓÃÒÔÏÂÏÂÁ
lsof -i
µÇ¼ºó¸´ÖÆ
¸ÃÏÂÁÏÔʾËùÓÐÕýÔÚʹÓõĶ˿ڣ¬ÒÔ¼°Ê¹ÓÃÕâЩ¶Ë¿ÚµÄÀú³Ì¡£
Ïà¹ØÔĶÁÍƼö£º
linux¶Ë¿ÚÕ¼ÓÃÔõô´¦Àí
linuxÔõôÉó²é¶Ë¿ÚÊÇ·ñ±»Õ¼ÓÃ
3. ss ÏÂÁî
ss ÏÂÁîÊÇ netstat ÏÂÁîµÄÔöÇ¿°æ±¾£¬ËüÌṩ¸ü¶à¹ØÓÚÍøÂçÅþÁ¬µÄÏêϸÐÅÏ¢¡£ÒªÉó²é±»Õ¼ÓõĶ˿ڣ¬¿ÉÒÔʹÓÃÒÔÏÂÏÂÁ
ss -tulpan
µÇ¼ºó¸´ÖÆ
¸ÃÏÂÁÏÔʾËùÓÐÕýÔÚʹÓÃµÄ TCP ºÍ UDP ¶Ë¿Ú£¬ÒÔ¼°ÓµÓÐÕâЩ¶Ë¿ÚµÄÀú³Ì¡£
4. fuser ÏÂÁî
fuser ÏÂÁî¿ÉÒÔƾ֤¶Ë¿ÚºÅ»òÎļþÐÎò·ûÀ´Ê¶±ðÀú³Ì¡£ÒªÉó²é±»Õ¼ÓõĶ˿ڣ¬¿ÉÒÔʹÓÃÒÔÏÂÏÂÁ
fuser -n tcp
µÇ¼ºó¸´ÖÆ
¸ÃÏÂÁÏÔʾÕýÔÚʹÓÃÖ¸¶¨¶Ë¿ÚµÄÀú³Ì¡£
ͨ¹ýʹÓÃÕâЩÏÂÁÄú¿ÉÒÔÇáËÉÉó²é Linux ϵͳÖб»Õ¼ÓõĶ˿ڣ¬²¢È·¶¨ÄÄЩÀú³ÌÕýÔÚʹÓÃËüÃÇ¡£
ÒÔÉϾÍÊÇlinuxÔõô¿´¶Ë¿Ú±»Õ¼ÓõÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡