How to determine the port used by an application or process

Hello everyone

I would like to know how i can determine the port used by an application in Linux. Say for example mysql database server or Apache2 web server.
Is it also possible to determine the current port number in case the default port number is changed?

Thanks for your help.

Hi

By using netstat you can determine the current port used by the application for ex look at the below command to know on which port apache is running.

# netstat -tulpn | grep -i httpd
1 Like