When you need to know process id attached with particular port use below command. pfiles /proc/* 2>/dev/null | nawk ' /^[0-9]*:/ { pid=$0 } /port: 7085 $/ { printf("%s %s\n",pid,$0);}' pfiles /proc/* is retrieving all processes file descriptors details 2>/dev/null is dropping out errors due to transient processes died in the meantime each line starting with a number followed by a colon reports the process id and details, it is stored in the awk pid variable when a line ends with the string port: <portnumber> (here is 7085), the corresponding pid variable is displayed. Note: you need the required privilege(s) to get port information from processes you do not own (root has all privileges).
All About Networking is a blog about Networking, Hardware, Software, IT Guide, Tech Info, Engineering Info, Networking tips, tricks and tutorials. Collection of Information and Solutions of all Networking problems .Solution for all software Hardware issues, Help-desk for IT Engineers, Web designers and Server Administrators