linux查看端口占用及kill端口

查看端口被哪个进程占用
lsof -i:8000
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
myserver 17997 SPREADTRUM\justin.wu 3u IPv4 593177169 0t0 TCP *:8000 (LISTEN)
myserver 17997 SPREADTRUM\justin.wu 4u IPv4 593177170 0t0 TCP localhost:8889->localhost:51258 (CLOSE_WAIT)

3)杀掉占用端口的进程 根据pid杀掉
kill -9 进程id

发表评论?

0 条评论。

发表评论


注意 - 你可以用以下 HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>