find what port a program runs

I did a ps -ef|grep web and
saw a web daemon running but
did not know what port it runs.
netstat -a show all the ports
associate with the process.

Is there an easy way to find out
what port is the process/program
use?
nngdemiAsked:
Who is Participating?
 
bewtainCommented:
i think you misunderstood the question :)
0
 
ahoffmannCommented:
. probably ;-)
If I want to know the port the web daemon is (means "should" as defined in  its config files) running on, I also could have checked the config files.
But the last question sound more than a general one: which  program uses which port
0
All Courses

From novice to tech pro — start learning today.