Reputation: 1941
I need to list all ports that a process in Solaris is listening to (similar to 'lsof -i -P' in Linux). Unfortunately the lsof command doesn't work, and I can't install it either. Is there any options? I've tried some netstat commands, but that doesn't show the port or pid.
Upvotes: 1
Views: 5625
Reputation: 734
a nice script using the command pfiles: http://www.oracle.com/technetwork/systems/security/pcp-149863.txt
Vince
Upvotes: 4
Reputation: 1
Use pfiles
pfiles
Report fstat(2) and fcntl(2) information for all open files in each process. For network endpoints, the local (and peer if connected) address information is also provided. For sockets, the socket type, socket options and send and receive buffer sizes are also provided. In addition, a path to the file is reported if the information is available from /proc/pid/path. This is not necessarily the same name used to open the file. See proc(4) for more information.
Upvotes: 3