Friday, January 22, 2010

Find out who is using your port

Many a times I forget this command. I have no Idea why.
So here it is, to your rescue the mighty lsof command

Just type this and you will have all the ports with their PID
# lsof -nl | egrep "TCP|UDP"

And then use ps for rest of your work. :)

UPDATE:
Since this was all good...there is even simpler way
adding -p option to netstat gives you the pid.


# netstat -anp | grep 'port number'

And again use ps for rest of your work.. :)

No comments:

Post a Comment