One, how to view the port of your own process.
1. View PID
In Task Manager, select View \ column, and in the Columns tab, put the PID number on it and you'll see the PID number of the process in Task Manager.
2 find port number by PID
Enter Netstat-ano in cmd
You can find the PID number for the port and the application
Second, how to view the specified port is occupied.
If we need to determine who's taking up our 9050 port,
1. Windows platform
Execute under Windows command-line window:
C:\>netstat-aon|findstr "9050"
TCP 127.0.0.1:9050 0.0.0.0:0 LISTENING 2016
See, Port is occupied by process number 2016 process, continue to execute the following command:
C:\>tasklist|findstr "2016"
Tor.exe Console 0 16,064 K
It's clear that Tor is taking up your port.
Under Linux:
Lsof-i: 80
Third, Linux
$netstat-pan|grep 2809
TCP 0 0 0.0.0.0:2809 0.0.0.0:* LISTEN 9493/java
del.icio.us tags:aix,windows,tips
NETSTAT [-A] [-b] [-e] [-n] [-O] [-P proto] [-r] [-S] [-v] [interval]
-a displays all connections and listening ports.
-B Displays the executable components that are included in creating each connection or listening port. In some cases, the executable component is known
has multiple independent components, and in these cases
A sequence of components that are included in creating a connection or listening port is displayed. In this case, the name of the executable component
At the bottom of [], the top is the component it calls, and so on, until the TCP/IP section. Note this option
It may take a long time to fail if insufficient permissions are available.
-e Displays Ethernet statistics. This option can be used in combination with the-s option.
-N Displays the address and port number in digital form.
-O Displays the owning process ID associated with each connection.
-p proto shows the connection proto the specified protocol; proto can be
One of the following protocols: TCP, UDP, TCPv6, or UDPV6.
If used with the-s option to display per-protocol statistics, Proto can be one of the following protocols:
IP, IPv6, ICMP, ICMPv6, TCP, TCPV6, UDP, or UDPV6.
-r Displays the routing table.
-S displays statistical information by protocol. By default, the display IP,
IPv6, ICMP, ICMPv6, TCP, TCPV6, UDP, and UDPV6 statistics;
The-p option specifies a subset of the default conditions.
-V is used with the-B option to display the containing
Creates a component that connects or listens on ports for all executable components.
Interval Displays the selected statistics, between each display
Pause interval (in seconds). Press CTRL + C to stop re-
Displays statistics. If omitted, Netstat displays the current
Configuration information (show only once)