关闭被占用端口

(一)Windows
D:\>netstat -aon|findstr 8086
  TCP    0.0.0.0:8086           0.0.0.0:0              LISTENING       1192

D:\>tasklist|findstr 1192
JAVAW.EXE                   1192 Console                 0      7,276 K

D:\>taskkill /pid 1192 /f
成功: 已终止 PID 为 1192 的进程。

(二)Linux
linux /oradata1/zjsmp/jzj 76 > netstat -pan|grep 8086
(Not all processes could be identified, non-owned process info
 will not be shown, you would have to be root to see it all.)
tcp        0      0 :::8086                 :::*                    LISTEN      11699/java
linux /oradata1/zjsmp/jzj 77 > kill -9 11699

[1]    Killed                        java Server

(三)AIX
$netstat -Aan|grep 30542

f10000f303321b58 tcp4 0 0 *.30542 *.* LISTEN

$rmsock f10000f303321b58 tcpcb

The socket 0x3321800 is being held by proccess 692476 (db2sysc).

你可能感兴趣的:(java,linux,windows,socket,AIX)