User-Profile-Image
hankin
  • 5
  • 首页
  • 分类
    • Windows
    • Web
    • VoIP
    • Virtualization
    • Trading
    • Smart Home
    • SEO
    • Security
    • Python
    • Program
    • PHP
    • OSX
    • OS
    • OpenSource
    • Nginx
    • MySQL
    • Mood
    • Linux
    • Life
    • Injection
    • Hosting
    • Finance
    • Exploits
    • CDN
  • 页面
    • About
  • 友链
    • 维酷科技
    • Tesra超算网络
Help?

Please contact us on our email for need any support

Support
  • 首页
    首页   ›   OS   ›   正文
OS

Linux和Windows 中查看端口被哪个程序占用

2014-06-26 07:07:54
2005  0 0

无论是在Linux还是Windows上都可能会遇到端口被占用nginx、mysql、apache等程序无法启动,下面说分别说一下Linux和Windows上如何查看端口被那个程序占用。

Linux篇:

使用命令:lsof -i:被占用的端口号

会显示出程序,及程序的PID,执行:kill 程序的PID 。

如果提示没有安装lsof这个命令,CentOS可以执行:yum install lsof 安装,Debian可以执行:apt-get install lsof 安装。

或者使用命令

netstat -anp | grep PortNo

Windows篇:

Windows上的工具比较多,如Active Ports,如果手头上没有现成的工具可以用命令:netstat -aon|findstr “80”

如下图:最后一列为程序PID,再通过tasklist命令:tasklist | findstr “2724”

再通过任务管理结束掉这个程序就可以了。

评论 (0)

Click here to cancel reply.

欢迎您 游客  

    ProdigYu
    180文章 77评论 4点赞 567063浏览
    随机文章
    Win10系统不能自动关闭显示器
    4年前
    关于Linux的正确读音,Linux怎么发音才是正确的
    5年前
    aria2 — Linux 下载工具
    12年前
    远程桌面管理器V2.2
    11年前
    Mac中如何像windows快速浏览多张图片
    5年前
    Tags
    Apache CentOS CMD DDOS Debian DNS Docker FastCGI Google IIS IP iptables Linux Mac MySQL Nginx Opensource PHP Python Skill SSH Ubuntu Vim VMware VPN web.py Windows 删除 命令 命令提示符 安装 开源 技巧 插件 漏洞 百度 系统 组件 终端 缓存 网络电话 脚本 自建 详解 错误
    Meta
    • Log in
    • Entries feed
    • Comments feed
    • WordPress.org
    Copyright © 2025
    主页
    页面
    • About
    博主
    ProdigYu 管理员
    Something about myself
    180 文章 77 评论 567064 浏览
    测试
    测试