在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(无条件强制终止进程)来结束进程。

最新文章

  1. Eclipse自动生成作者、日期注释等功能设置
  2. 解决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`)
  3. eclipse emacs
  4. VIM配置相关记录
  5. **对比$_POST、$GLOBALS['HTTP_RAW_POST_DATA']和file_get_contents('php://input')
  6. Sonar+Hudson+Maven构建系列之一:安装Sonar
  7. 【ERROR】---Error executing "adb devices":ADB server didn't ACK
  8. ECshop--导航栏模块细究
  9. Qt5官方demo分析集29——Extending QML - Property Value Source Example
  10. SpringMVC入门笔记一
  11. Attempt to write to field 'android.support.v4.app.FragmentManagerImpl android.support.v4.app.Fragment.mFragmentManager' on a null object reference
  12. MyBatis-Generator的配置说明和使用
  13. Manual | BSD手册| Linux手册 | 数据库手册 | 编程开发手册 | WEB开发手册 | 软件应用手册 | 网络技术手册 | GNU手册
  14. 添加OpenStack Mitaka源
  15. Java中语法与C/CPP的区别
  16. 「Android」 基于Binder通信的C/S架构体系认知
  17. 官方Canvas API文档
  18. iOS开发-观察者模式
  19. react native 第三方组件react-native-swiper 轮播组件
  20. SSL&HTTPS简单介绍

热门文章

  1. 安装STS报错(二)
  2. boost asio allocation
  3. xml文件的规则
  4. Mybatis if test 中int判断非空的坑
  5. activemq的案例
  6. HALCON学习-资料
  7. Linux命令top 详解
  8. 第二篇:操纵MySQL数据库(2) - 基于ORM思想的SQLAlchemy库
  9. python数据类型——字典类型
  10. Linux初学者的总结