进程监听Windows上的哪个端口

如何找出哪个进程正在监听Windows和Linux上的哪个端口? 是否有一些应用程序明确监控?


在Windows 7上,您可以使用

netstat -b -a

netstat /?

-b      Displays the executable involved in creating each connection or
          listening port. In some cases well-known executables host
          multiple independent components, and in these cases the
          sequence of components involved in creating the connection
          or listening port is displayed. In this case the executable
          name is in [] at the bottom, on top is the component it called,
          and so forth until TCP/IP was reached. Note that this option
          can be time-consuming and will fail unless you have sufficient
          permissions.
-o      Displays the owning process ID associated with each connection.

在Linux上使用时, -p需要root权限。

#netstat -p

#netstat -h
-p, --programs           display PID/Program name for sockets

一些很棒的工具是由微软现在拥有的Sysinternals完成的。

你需要的是Tcpview,它会告诉你端口和哪个应用程序打开它们,以及PID和其他好东西。 Tcpview是基于Windows的,但他们也有一个命令行版本。 所有这些工具都是免费的。

这是微软的sysinternals下载链接


Windows和Linux都具有内置的netstat ,尽管它们的使用方式不同。

在Windows上: netstat -a -b (列出侦听和连接的端口)

在Linux上: netstat -l -p (仅列出侦听端口)

链接地址: http://www.djcxy.com/p/30295.html

上一篇: Process listening which Port on Windows

下一篇: How to kill a process running on particular port in Linux?