Hi,
To see if the port is used (is listening) then :
#for tcp
netstat -tnl
#for udp
netstat -unl
To see what process (program) is using a specific port then:
fuser -n tcp 80
where 80 is the port. You will get minimum 1 pid or more if is a multithreaded server (apache for example). Ex:
80/tcp: 2193 2277 2278 2279 2295 2813 3982 3983 8733 8734 8739
Now if you see what process it is :
ps auxwww | grep 2193
and the answer will be
root 2193 0.0 6.0 30232 7628 ? Ss Jul16 0:00 /usr/sbin/apache2 -k start -DSSL
It's enough for you ?
Regards