linux 查看端口号对应的进程信息

hackerlpy 2011-12-09

引用
[hadoop@hhumaster ~]$ lsof -i:22

COMMANDPIDUSERFDTYPEDEVICESIZE/OFFNODENAME

ssh6796hadoop3uIPv6298090t0TCPlocalhost:56470->localhost:ssh(ESTABLISHED)

[hadoop@hhumaster~]$netstat-nlp|grep9000

(Notallprocessescouldbeidentified,non-ownedprocessinfo

willnotbeshown,youwouldhavetoberoottoseeitall.)

tcp00::ffff:121.248.200.26:9000:::*LISTEN9302/java

[hadoop@hhumaster~]$lsof-i:9000

COMMANDPIDUSERFDTYPEDEVICESIZE/OFFNODENAME

java9302hadoop37uIPv6390770t0TCPhhumaster:cslistener(LISTEN)

java9302hadoop52uIPv6400970t0TCPhhumaster:cslistener->hhudatanode3:36717(ESTABLISHED)

java9302hadoop53uIPv6404300t0TCPhhumaster:cslistener->hhudatanode5:58580(ESTABLISHED)

java9302hadoop54uIPv6405950t0TCPhhumaster:cslistener->hhudatanode2:59142(ESTABLISHED)

java9302hadoop56uIPv6409240t0TCPhhumaster:cslistener->hhudatanode4:41856(ESTABLISHED)

-p,--programsdisplayPID/Programnameforsockets

-c,--continuouscontinuouslisting

-l,--listeningdisplaylisteningserversockets

相关推荐