Skip to content
Advertisement

Equivalent lsof -i in Solaris

I have a fast question. I want to know what is the losf -i equivalent command in a Solaris system.

I only want to show the files with network connection.

Thank you!!

Advertisement

Answer

Here is a shell script that list all processes having open TCP or UDP ports on Solaris, you can limit it to a given port number by passing it as an argument:

JavaScript

Note: As documented in the warning section of the pfiles manual page, it is not recommended to run this command on a heavily loaded production system with a time sensitive process running as deadlocks or crashes might happen.

Note #2: The previous warning doesn’t apply to the last update of Solaris (Oracle Solaris 11.4) because pfiles no more suspend the monitored process(es). It now just uses ad hoc /proc pseudo files.

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement