Process listening which Port on Windows

How can you find out which process is listening upon which port on Windows and Linux? Are there some Applications explicitly monitoring?


On windows 7, you can use

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.

On Linux use, -p needs root privileges.

#netstat -p

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

Some great tools for this are made by Sysinternals, now owned by Microsoft.

The one you want is Tcpview and it will show you the ports and which application has them opened, as well as the PID and other nice things. Tcpview is windows based but they have a command line version as well. All these tools are free.

This is the link Microsoft's sysinternals downloads


Both Windows and Linux has the netstat -command built-in, although they are used differently.

On Windows: netstat -a -b (lists both listening and connected ports)

On Linux: netstat -l -p (lists only listening ports)

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

上一篇: 如何在Windows控制台上输出Unicode字符串

下一篇: 进程监听Windows上的哪个端口