![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| IP Networking Questions involving TCP/IP, Routers, Hubs, Network protocols, etc go here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Get CDE/dtlogin to stop listening on port 6000 | AIXNewbie | AIX | 0 | 03-20-2008 01:25 PM |
| VNC Server http listening port | kxchen_home | Linux | 6 | 02-06-2004 09:23 PM |
| Listening on port for incoming data? | frustrated1 | Shell Programming and Scripting | 6 | 01-16-2004 03:48 PM |
| port not listening.. | Prafulla | IP Networking | 1 | 12-12-2001 06:46 AM |
| Perl Script Listening On A TCP Port | emcb | Shell Programming and Scripting | 1 | 12-04-2001 10:19 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
how to find port numbers a web server is listening to
I want to write a program to list all port numbers a process like web server is listening to.Is there a any unix command to find the port numbers and the processes(pid) connected to that port.
|
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
Quote:
u can write the script in shell for a particular task of listing in linux we have commands lsof -i TCP (displays online open tcp ports) lsof -i UDP above commands work for linux only netstat -anp | head -20 nmap -anp ( if the nmap utility is installed in linux system) thru netstat only we can get much of the information regarding the open ports |
|
#3
|
||||
|
||||
|
you can also use "sockstat" if applicable.
|
|
#4
|
|||
|
|||
|
Quote:
sockstat works on BSD netstat can be used for unix platform of solaris,hpux |
|
#5
|
|||
|
|||
|
netstat -na |grep LISTEN to find the listening ports in HP-UX,Solaris
netstat -na|grep CONNECTED to find the ports connected in Linux box. |
|
#6
|
|||
|
|||
|
On solaris:
pfiles <pid> |
|
#7
|
||||
|
||||
|
You can try, on linux,
Code:
# netstat -lpn | grep httpd on freebsd systems try Code:
# sockstat -ln | grep httpd |
||||
| Google The UNIX and Linux Forums |
| Tags |
| linux |
| Thread Tools | |
| Display Modes | |
|
|