进程监听哪个端口在Windows上

时间:2012-11-05 08:55:00

标签: linux windows networking

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

5 个答案:

答案 0 :(得分:1)

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

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

This is the link Microsoft's sysinternals downloads

答案 1 :(得分:1)

Windows和Linux都内置了netstat - 命令,尽管它们的使用方式不同。

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

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

答案 2 :(得分:0)

不确定stackoverflow是否适合此问题,http://www.superuser.com可能是更好的选择。

虽然从头到尾:

  • Linux有lsofnetstat命令可以提供此信息。
  • Windows有ProcessExplorer应提供此信息。

答案 3 :(得分:0)

在Linux中,您可以使用ss命令转储套接字信息。它还提供有关客户端活动端口号的信息。更多详情可在这找到 http://linux.die.net/man/8/ss

答案 4 :(得分:0)

在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
相关问题