Use fuser -n tcp <port id> for tcp ports to see which process is using the port.
For example to see which application is already using port 80 use:
$ fuser -n tcp 80
The netstat command can also be used to determine what process is using a port.
Use netstat -nlp and you should see PID and names of programs along with the port they are using (note you can only see the PID of process you own, unless running as root)
$ netstat --nlp
On Win XP i dont see 'l' option, is this some custom version of netstat.
On Win 2K3 the options are as follows (sorry, I don't have an XP system
handy to see if they are the same):
netstat -a -b -o -n
-a: gets listening processes (similar to -l on linux)
-b: displays the executable name that started using the port (similar to -p on linux)
-o: displays the process id (PID) that owns the connection
-n: (optional) gives the addresses numerically (same as -n on linux)
# lsof|grep 862
ypbind 1529 root 5u IPv4 4681 TCP *:862
(LISTEN)
The simplest method I've found is to do
A simple way i found to know whether the port is already used by any
application.
telnet localhost <port-number>
I want to find out which application is using a port on my XP machine. I
tried using the netstat -aon command but it dosen't show the port in use.
Is ther any other way to find out which application is using the port.
I have also tried telnet that too shows that the port is in use.
Now can any1 help me tofind the application using the port.
I used netstat -na -o to list all active ports and their owner. Owner is
lised as PID (process ID)
In my case:
netstat -nlp worked as opposed to netstat --nlp