linux - 了解 netstat 输出

标签 linux networking

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/

相关文章:

linux - 从 cshell (tcsh) 执行 bash shell

mysql - 如何在使用 mysqld_safe 运行 MySQL 后停止它?

Java:开始学习基础网络的最佳起点

c# - 你如何在 C# 中获取原始 TCP 数据包?

c - 如何在 c 中使用 openssl 创建聊天服务器

linux - 在没有推送访问权限的情况下同步两个 git 克隆

linux - 无法使用 HAProxy 将客户端 IP 转发到服务器

c - miniupnpsssdpd 查询已连接设备数失败

ios - 如何在 NWConnection 中设置 UDP 广播的发送方端口

C++ 如何在 Winsock 中正确接收文件?