In Unix/Linux PID of the port used can be found by
netstat --listen
OR
netstat -l
OR
netstat -aun
OR
netstat -an|grep LISTEN will give you list of opened ports
Problem is with Solaris (10). There is no direct command to find the same.
I found following links to execute shell scripts:
https://blogs.oracle.com/opengrok/get-application-pid-listening-on-a-network-port-in-solaris-aka-netstat-npl-in-solaris
https://geekflare.com/check-pid-using-port-number-solaris/
But I could not executed any of these and finally found following:
PORT=19028; for PID in /proc/*; do pfiles ${PID} |grep "port: ${PORT}" && echo ${PID}; done
you may have to search for AF_INET
If you have ROOT permission, then you may find any port's PID else it can help you to find the port at least opened by you.
netstat --listen
OR
netstat -l
OR
netstat -aun
OR
netstat -an|grep LISTEN will give you list of opened ports
Problem is with Solaris (10). There is no direct command to find the same.
I found following links to execute shell scripts:
https://blogs.oracle.com/opengrok/get-application-pid-listening-on-a-network-port-in-solaris-aka-netstat-npl-in-solaris
https://geekflare.com/check-pid-using-port-number-solaris/
But I could not executed any of these and finally found following:
PORT=19028; for PID in /proc/*; do pfiles ${PID} |grep "port: ${PORT}" && echo ${PID}; done
you may have to search for AF_INET
If you have ROOT permission, then you may find any port's PID else it can help you to find the port at least opened by you.
No comments:
Post a Comment