What process is listening on a certain port on Solaris?

后端 未结 11 1216
情话喂你
情话喂你 2020-12-13 02:24

So I log into a Solaris box, try to start Apache, and find that there is already a process listening on port 80, and it\'s not Apache. Our boxes don\'t have lsof installed,

11条回答
  •  心在旅途
    2020-12-13 02:59

    #!/usr/bin/bash
    # This is a little script based on the "pfiles" solution that prints the PID and PORT.
    
    pfiles `ls /proc` 2>/dev/null | awk "/^[^ \\t]/{smatch=\$0;next}/port:[ \\t]*${1}/{print smatch, \$0}{next}"
    

提交回复
热议问题