Sometimes it's necessary to know which ports are in listening
state and which programs are listening on them. For example you want to run a
program which uses special port but when that port is busy, the program reports
an error. I've had this situation with apache web server which it could not
start because the tcp port 443 was not available. To solve this problem you
should first find which program is using the specified port and then kill the
bothersome program. To find which program is using specified port you can use
the "netstat" command. For example to find which program is using port 443 you
can run the following command:
# netstat -anp | grep 443
The result is something like this:
tcp 0 0 :::443 :::* LISTEN 467/httpd
To find more information about this, visit the following
pages: