linux port is occupied close the port

1. Check whether the port is occupied

netstat -anp |grep [端口号]

Insert image description here

2. Check the occupied processes

lsof -i:[端口号]

Insert image description here

3. Close the process

kill -9 [进程PID]

LISTEN means occupied, 3061/java respectively: process PID/process closes the process through process PID

Guess you like

Origin blog.csdn.net/weixin_45265547/article/details/131665072