- For individual users
- Instant access to solutions
- Ask your tech questions
- Start your 30-day Free Trial
Main Topics
Browse All TopicsI need a command that I can type on a single line that will show me all the ports in use and the name of the programs (eventually also the path) using them.
I searched EE and found some similar questions but without the solution I need:
http://www.experts-exchang
http://www.experts-exchang
I cannot install lsof, nor I can install other software. I'm looking for a solution that I can use on every solaris machine (mostly solaris 9 or 8, but if it works also on solaris 7 it would be great) I will access without installing anything.
To make you better understand what I neet: under ubuntu linux I can achieve my goal by issuing this command:
netstat -lpn
which gives me a list like this:
root@myserver:/etc/apt # netstat -lpn
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN 11883/mysqld
tcp 0 0 0.0.0.0:139 0.0.0.0:* LISTEN 6512/smbd
tcp 0 0 0.0.0.0:5901 0.0.0.0:* LISTEN 6770/Xtightvnc
tcp 0 0 0.0.0.0:110 0.0.0.0:* LISTEN 6546/dovecot
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 6732/apache
tcp 0 0 0.0.0.0:6001 0.0.0.0:* LISTEN 6770/Xtightvnc
tcp 0 0 0.0.0.0:25 0.0.0.0:* LISTEN 6375/inetd
tcp 0 0 0.0.0.0:445 0.0.0.0:* LISTEN 6512/smbd
tcp6 0 0 :::22 :::* LISTEN 6531/sshd
...
the list goes on giving me also the active sockets...
This list is very nice as it showes the "local address" (=port) and the "program name" which is what I need to see.
under solaris:
netstat -an gives me a list which is quite unusable and no program name is showed.
This question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Business Accounts
Answer for Membership