国内最全IT社区平台 联系我们 | 收藏本站
华晨云阿里云优惠2
您当前位置:首页 > 数据库 > 数据库应用 > Linux 通过os进程pid找到端口号

Linux 通过os进程pid找到端口号

来源:程序员人生   发布时间:2015-03-20 08:33:19 阅读次数:2522次
[root@localhost ~]# netstat -tulpn Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 127.0.0.1:2208 0.0.0.0:* LISTEN 3338/./hpiod tcp 0 0 0.0.0.0:736 0.0.0.0:* LISTEN 3098/rpc.statd tcp 0 0 127.0.0.1:37094 0.0.0.0:* LISTEN 4418/ocssd.bin tcp 0 0 0.0.0.0:54955 0.0.0.0:* LISTEN 4919/ora_d000_orcl tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 3058/portmap tcp 0 0 0.0.0.0:1521 0.0.0.0:* LISTEN 4974/tnslsnr tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 3358/sshd tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN 3369/cupsd tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 3404/sendmail tcp 0 0 127.0.0.1:43259 0.0.0.0:* LISTEN 4418/ocssd.bin tcp 0 0 127.0.0.1:2207 0.0.0.0:* LISTEN 3343/python udp 0 0 127.0.0.1:33429 0.0.0.0:* 4418/ocssd.bin udp 0 0 127.0.0.1:20633 0.0.0.0:* 4921/ora_s000_orcl udp 0 0 0.0.0.0:21080 0.0.0.0:* 3763/avahi-daemon udp 0 0 127.0.0.1:13017 0.0.0.0:* 4891/ora_pmon_orcl udp 0 0 0.0.0.0:730 0.0.0.0:* 3098/rpc.statd udp 0 0 0.0.0.0:733 0.0.0.0:* 3098/rpc.statd udp 0 0 127.0.0.1:7394 0.0.0.0:* 4418/ocssd.bin udp 0 0 0.0.0.0:5353 0.0.0.0:* 3763/avahi-daemon udp 0 0 127.0.0.1:63341 0.0.0.0:* 4418/ocssd.bin udp 0 0 0.0.0.0:111 0.0.0.0:* 3058/portmap udp 0 0 0.0.0.0:631 0.0.0.0:* 3369/cupsd udp 0 0 127.0.0.1:16633 0.0.0.0:* 4919/ora_d000_orcl udp 0 0 127.0.0.1:61818 0.0.0.0:* 4418/ocssd.bin


下面根据os进程id(4974)检查使用的端口号:

[root@localhost ~]# netstat -nap | grep 4974 tcp 0 0 0.0.0.0:1521 0.0.0.0:* LISTEN 4974/tnslsnr tcp 0 0 127.0.0.1:1521 127.0.0.1:11798 ESTABLISHED 4974/tnslsnr unix 2 [ ACC ] STREAM LISTENING 15990 4974/tnslsnr /var/tmp/.oracle/s#4974.1 unix 2 [ ACC ] STREAM LISTENING 15992 4974/tnslsnr /var/tmp/.oracle/s#4974.2 unix 3 [ ] STREAM CONNECTED 14974 4663/gconfd⑵ [root@localhost ~]#

 

生活不易,码农辛苦
如果您觉得本网站对您的学习有所帮助,可以手机扫描二维码进行捐赠
程序员人生
------分隔线----------------------------
分享到:
------分隔线----------------------------
关闭
程序员人生