List of Ports being used.

Hi,

I have 2 queries:

a) Is it possible that a port no., not defined in /etc/services, be used by an application.

b) how do i find the list of ports is being currently used on my Solaris box(if entry not made into /etc/services) I donot have "lsof" installed on my box.

You can use the -n option to netstat to get port numbers instead of having the utility try to provide names for services:

netstat -an | egrep 'Proto|LISTEN'

yes

/etc/services does not necessarily show what ports are open on your specific host. its more a repository for translating port numbers to more meaningful, human readable names... and those that are properly registered with the iana. (NIS maps "services.byname" and the NIS+ table "services" are counterparts).

if you run `netstat -a`, /etc/services will be used to translate a port number to a meaningful name. if you run `netstat -an`, port numbers will not be translated.

you can change /etc/services to whatever you like.

you could probably use super-handy pcp.sh script