List process by port number netstat -ano | findstr 8080 Proto Local Address Foreign Address State PID TCP 0.0.0.0:8080 0.0.0.0:0 LISTENING 29848 -a – Displays all connections and listening ports. -o – Displays the owning process ID associated with ea
1. vi /tmp/test.ksh #!/bin/ksh line='---------------------------------------------' pids=$(/usr/bin/ps -ef -o pid=) if [ $# -eq 0 ]; then read ans?"Enter port you would like to know pid for: " else ans=$1 fi for f in $pids do /usr/proc/bin/pfile