Understanding the netstat output

匿名 (未验证) 提交于 2019-12-03 00:44:02

问题:

tcp        0      0  :::111                      :::*                        LISTEN 

Above is the output of netstat -nl | grep 111What is the meaning of :::111 segment?

回答1:

technet.microsoft.com says that:

Displays active TCP connections, ports on which the computer is listening, Ethernet statistics, the IP routing table, IPv4 statistics (for the IP, ICMP, TCP, and UDP protocols), and IPv6 statistics (for the IPv6, ICMPv6, TCP over IPv6, and UDP over IPv6 protocols). Used without parameters, netstat displays active TCP connections.

So you can find which addresses and ports are used and listening. for example you want to run a Tomcat server on port 8080. but it used. so you can run:

netstat -ano | find "8080" 

output will be something like:

 TCP    0.0.0.0:8080           0.0.0.0:0              LISTENING       1185  TCP    [::]:8080              [::]:0                 LISTENING       1185 

It says that process number 1196 is using this port. If it is necessary to use this port you can shutdown the app that use this port and run your server on it by this command:

taskkill /F /PID 1185 


标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!