How to find which process uses which port

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 :80

or

lsof -i :1226

Or

lsof | grep [process name]

Share on Twitter
Share on Facebook

BLACK

FRIDAY

DEALS

UP TO 60% OFF
Friday November 27th starts at 9am EST.
While supplies last!