How To Find What Linux Process Is Using What Port
October 6th, 2009
If sometimes you need to know what process is using which port. This capability is especially useful if you have several processes with the same name, but a different PID.
A handy utility is lsof, that gets the job done. If you wanted to know what process is using port 1226, or port 80, etc, just use the following:
lsof -i :portnumber
Example: lsof -i :80
We can use:
watch lsof -i :80
Or we can use:
lsof | grep [process name]