0
点赞
收藏
分享

微信扫一扫

如何在 Linux 中删除在特定端口上运行的进程

624c95384278 2022-07-27 阅读 32

以 80 端口为例。

首先,列出任何监听端口 80 的进程:

# 使用 lsof 
$ lsof -i:80

# 使用 fuser
$ fuser 80/tcp

使用 ​​kill​​ 命令删除任何监听端口 80 的进程:

$ kill $(lsof -t -i:80)
$ kill -9 $(lsof -t -i:80)

或使用 ​​fuser​​ 命令:

$ fuser -k 80/tcp

更多资源

  • ​​Finding the PID of the process using a specific port?​​
  • ​​How to kill a process running on particular port in Linux?​​
举报

相关推荐

0 条评论