首页 文章

进程监听哪个端口在Windows上

提问于
浏览
0

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

5 回答

  • 1

    在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
    
  • 0

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

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

    This is the link Microsoft's sysinternals downloads

  • 0

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

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

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

  • 0

    不确定stackoverflow是否适合这个问题,也许http://www.superuser.com会是更好的选择 .

    虽然从头到尾:

    • Linux有 lsofnetstat 命令将提供此信息 .

    • Windows有 ProcessExplorer 应提供此信息 .

  • 1

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

相关问题