Determine what process is listening on a port on Solaris, without lsof

\"Desktop
Image by Metsuke iLife via Flickr

$ for x in `ptree | awk \'{print $1}\’`; do pfiles $x | grep ${PORT} > /dev/null 2>&1; if [ x\”$?\” == \”x0\” ]; then ps -ef | grep $x | grep -v grep; fi; done 2> /dev/null

Can use lsof, but since it\’s not part of the base OS, it\’s not always available.

URL: http://feedproxy.google.com/~r/Command-line-fu/~3/lV75MK3xrqs/determine-what-process-is-listening-on-a-port-on-solaris-without-lsof

\"Reblog

About Amit Agarwal