gpt4 book ai didi

linux - 了解 netstat 输出

转载 作者:塔克拉玛干 更新时间:2023-11-02 23:34:25 25 4
gpt4 key购买 nike

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

以上是 netstat -nl | 的输出grep 111:::111段是什么意思?

最佳答案

technet.microsoft.com 说:

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.

所以你可以找到哪些地址和端口被使用和监听。例如,你想在端口 8080 上运行一个 Tomcat 服务器。但它用过。所以你可以运行:

netstat -ano | find "8080"

输出会是这样的:

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

它说进程号1185正在使用这个端口。如果有必要使用此端口,您可以关闭使用此端口的应用程序并通过此命令在其上运行您的服务器:

taskkill /F /PID 1185

关于linux - 了解 netstat 输出,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40277020/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com