查看端口使用情况(lsof,netstat, kill)
2024-10-19 00:22:43
在Mac上查看端口使用情况只能使用lsof(list open file),无法使用 netstat。
查看某个端口是否正在被占用:
lsof -i:portno
另外,可以通过:
lsof
指令来查看所有被占用的端口信息,然后通过 | grep xxx 来过滤应用程序信息。
在LInux系统上使用netstat查看所有被监听的端口:
netstat -l
继续过滤某个端口:
netstat -l | grep ':portno'
查找到占用某个端口的pid之后,可通过 kill pid(不带 -signum,默认发15 SIGTERM)或者 kill -9 pid(无条件强制终止进程)来结束进程。
最新文章
- Eclipse自动生成作者、日期注释等功能设置
- 解决Cannot delete or update a parent row: a foreign key constraint fails (`current_source_products`.`product_storage`, CONSTRAINT `product_storage_ibfk_3` FOREIGN KEY (`InOperatorID`)
- eclipse emacs
- VIM配置相关记录
- **对比$_POST、$GLOBALS['HTTP_RAW_POST_DATA']和file_get_contents('php://input')
- Sonar+Hudson+Maven构建系列之一:安装Sonar
- 【ERROR】---Error executing ";adb devices";:ADB server didn't ACK
- ECshop--导航栏模块细究
- Qt5官方demo分析集29——Extending QML - Property Value Source Example
- SpringMVC入门笔记一
- Attempt to write to field 'android.support.v4.app.FragmentManagerImpl android.support.v4.app.Fragment.mFragmentManager' on a null object reference
- MyBatis-Generator的配置说明和使用
- Manual | BSD手册| Linux手册 | 数据库手册 | 编程开发手册 | WEB开发手册 | 软件应用手册 | 网络技术手册 | GNU手册
- 添加OpenStack Mitaka源
- Java中语法与C/CPP的区别
- 「Android」 基于Binder通信的C/S架构体系认知
- 官方Canvas API文档
- iOS开发-观察者模式
- react native 第三方组件react-native-swiper 轮播组件
- SSL&;HTTPS简单介绍