netstat 查詢佔port的程式為何

因為要要重啟apache失敗了,
所以只好下指令查詢是哪個小王八蛋佔住port不放…

[root@WP html]# netstat -npl
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address               Foreign Address             State       PID/Program name
tcp        0      0 0.0.0.0:**                  0.0.0.0:*                   LISTEN      1437/s***
tcp        0      0 0.0.0.0:**                  0.0.0.0:*                   LISTEN      1738/r***
tcp        0      0 127.0.0.1:**                0.0.0.0:*                   LISTEN      1661/m***
tcp        0      0 0.0.0.0:**                  0.0.0.0:*                   LISTEN      1739/r***
tcp        0      0 0.0.0.0:**                  0.0.0.0:*                   LISTEN      1682/q***

以下為 man netstat 的說明

SYNOPSIS
       netstat  [address_family_options]  [--tcp|-t]  [--udp|-u]  [--raw|-w]  [--listening|-l]   [--all|-a]
       [--numeric|-n]          [--numeric-hosts][--numeric-ports][--numeric-ports]          [--symbolic|-N]
       [--extend|-e[--extend|-e]] [--timers|-o] [--program|-p] [--verbose|-v] [--continuous|-c] [delay]

       netstat    {--route|-r}    [address_family_options]    [--extend|-e[--extend|-e]]     [--verbose|-v]
       [--numeric|-n] [--numeric-hosts][--numeric-ports][--numeric-ports] [--continuous|-c] [delay]

       netstat   {--interfaces|-I|-i}   [iface]   [--all|-a]  [--extend|-e]  [--verbose|-v]  [--program|-p]
       [--numeric|-n] [--numeric-hosts][--numeric-ports][--numeric-ports] [--continuous|-c] [delay]

       netstat {--groups|-g} [--numeric|-n] [--numeric-hosts][--numeric-ports][--numeric-ports] [--continu-
       ous|-c] [delay]

       netstat {--masquerade|-M} [--extend|-e] [--numeric|-n] [--numeric-hosts][--numeric-ports][--numeric-
       ports] [--continuous|-c] [delay]

       netstat {--statistics|-s} [--tcp|-t] [--udp|-u] [--raw|-w] [delay]

       netstat {--version|-V}

       netstat {--help|-h}

       address_family_options:

       [--protocol={inet,unix,ipx,ax25,netrom,ddp}[,...]]   [--unix|-x]  [--inet|--ip]   [--ax25]   [--ipx]
       [--netrom] [--ddp]
This entry was posted in Linux. Bookmark the permalink.