使用指令:
netstat|rmsock
1、netstat查看端口信息
netstat -Aan|grep 6666
终端输出
f10005000037cbb0 tcp4 0 0 172.17.252.214.501 172.17.252.8.6666 ESTABLISHED
f1000500002bc3b0 tcp4 0 0 172.17.252.214.508 172.17.252.5.6666 ESTABLISHED
f10005000bb70bb0 tcp4 0 0 172.17.252.214.525 172.17.252.8.6666 ESTABLISHED
f10005000bbfbbb0 tcp4 0 0 172.17.252.214.525 172.17.252.8.6666 ESTABLISHED
f10005000bbed3b0 tcp4 0 0 172.17.252.214.529 172.17.252.8.6666 ESTABLISHED
f10005000bba73b0 tcp4 0 0 172.17.252.214.540 172.17.252.8.6666 ESTABLISHED
f10005000bbff3b0 tcp4 0 0 172.17.252.214.541 172.17.252.5.6666 ESTABLISHED
f10005000bc923b0 tcp4 0 0 172.17.252.214.544 172.17.252.8.6666 ESTABLISHED
f10005000bc123b0 tcp4 0 0 172.17.252.214.545 172.17.252.8.6666 ESTABLISHED
f10005000036d3b0 tcp4 0 0 172.17.252.214.546 172.17.252.5.6666 ESTABLISHED
f10005000bcd73b0 tcp4 0 0 172.17.252.214.546 172.17.252.8.6666 ESTABLISHED
f10005000bbb63b0 tcp4 0 0 172.17.252.214.561 172.17.252.8.6666 ESTABLISHED
f1000500002ef3b0 tcp4 0 0 172.17.252.214.564 172.17.252.8.6666 ESTABLISHED
f10005000bbe4bb0 tcp4 0 0 172.17.252.214.570 172.17.252.8.6666 ESTABLISHED
f1000500003023b0 tcp4 0 0 172.17.252.214.572 172.17.252.5.6666 ESTABLISHED
2、如果是TCP连接,则使用:
rmsock f10005000037cbb0 tcpcb
如果是UDP连接,则使用:
rmsock f10005000037cbb0 inpcb
输出结果:
The socket 0x37c808 is being held by proccess 11796492 (flow).
3、根据PID查询详细信息
ps -ef|grep 11796492
输出结果:
cmsp_it1 11796492 1 0 09时00分01秒 pts/5 0:00 flow -C dom=CMSP -g 3 -i 1034 -u P570_X_1 -U /cmsp/usr/cmsp_it1/log/ULOG -m 0 -A
分享到:
评论