最近遇到几次故障,端口被其他进程占用了,需要确认是给什么进程占用.
netstat -an是查不出端口对应进程.
查了一个可以使用hp的lsof软件,下载路径:
找lsof,目前版本是4.78
下载后解开安装,命令路径在/usr/local/bin/lsof
使用lsof -i 可以查到程序名,进程号
如果查9090端口
test:[/tmp/hjf] #lsof -i|grep 9090
java 29607 sync 30u IPv4 0x12b6ce380 0t0 TCP *:9090 (LISTEN)
java 29607 sync 35u IPv4 0x122c194c0 0t1343 TCP zy:9090->10.17.109.110:1206 (ESTABLISHED)
java 29607 sync 36u IPv4 0xca46d9c0 0t2680 TCP zy:9090->172.16.4.109:1105 (ESTABLISHED)
java 29607 sync 37u IPv4 0x126e140c0 0t2796 TCP zy:9090->172.16.4.111:1094 (ESTABLISHED)
java 29607 sync 38u IPv4 0x105c25b80 0t2409 TCP zy:9090->172.16.4.122:1576 (ESTABLISHED)
java 29607 sync 39u IPv4 0x106bc4040 0t500 TCP zy:9090->10.17.77.96:1300 (ESTABLISHED)
java 29607 sync 41u IPv4 0xca2a1dc0 0t443 TCP zy:9090->132.97.238.187:1642 (ESTABLISHED)
java 29607 sync 42u IPv4 0x12245f200 0t2443 TCP zy:9090->132.97.191.143:2928 (ESTABLISHED)
java 29607 sync 47u IPv4 0x122c19dc0 0t2347 TCP zy:9090->10.17.109.110:1207 (ESTABLISHED)
test:[/tmp/hjf] #ps -ef|grep 29607
sync 29607 1 0 May 19 ? 163:02 /opt/java1.4/bin/PA_RISC2.0/java -server -Xms128m -Xmx512m -Dja
root 17445 16305 1 17:31:19 pts/to 0:00 grep 29607
阅读(1990) | 评论(0) | 转发(0) |