Mac OS/Linux命令查询网络端口占用情况

 

netstat命令

netstat -an | grep 3306

3306替换成需要grep的端口号

lsof命令

通过list open file命令可以查看到当前打开文件,在linux中所有事物都是以文件形式存在,包括网络连接及硬件设备。

lsof -i:80

-i参数表示网络链接,:80指明端口号,该命令会同时列出PID,方便kill

查看所有进程监听的端口

sudo lsof -i -P | grep -i "listen"

mac查看端口占用的更多相关文章

  1. Mac查看端口占用情况

    Mac下使用lsof(list open files)来查看端口占用情况,lsof 是一个列出当前系统打开文件的工具. 使用 lsof 会列举所有占用的端口列表: $ lsof 使用less可以用于分 ...

  2. Mac 查看端口占用情况及杀死进程

    查看端口占用情况命令 sudo lsof -i :9000 冒号后面就是你需要查看的端口号. TheEternityZhang-MacBook:project zhtony$ sudo lsof -i ...

  3. MAC 查看端口占用

    命令 lsof -i tcp:[port]  (port替换成端口号,比如6379)可以查看该端口被什么程序占用,并显示PID,方便KILL 之后,kill -9  [PID] , kill进程即可 ...

  4. Mac 查看端口占用及杀死进程

    lsof -i : kill -

  5. Mac下查看端口占用情况

    为什么 后端开发时,有时会碰到服务无法正常启动,端口被占用.这时需要查看端口占用情况. 是什么 需要用到一些Linux命令. 怎么做 查看占用端口51805的进程 lsof -n -P -i TCP ...

  6. Windows、Linux及Mac查看端口和杀死进程

    本文介绍如何在Windows.Linux及Mac下查看端口和杀死进程. Windows下查看端口和杀死进程 查看占用端口号的进程号:netstat –ano | findstr "指定端口号 ...

  7. Window和Mac下端口占用情况及处理方式

    1. 在Mac下端口占用的情况: 找到占用的进程并杀掉: 1.查看端口占用进程 sudo lsof -i :8880 可以看到进程的PID 2.杀掉进程 sudo kill -9 4580(4580为 ...

  8. iptables总结,开启端口,查看端口占用情况

    Centos查看端口占用情况和开启端口命令 Centos查看端口占用情况命令,比如查看80端口占用情况使用如下命令: lsof -i tcp:80 列出所有端口 netstat -ntlp mac上查 ...

  9. Dos命令查看端口占用及关闭进程

    1. 查看端口占用 在windows命令行窗口下执行: netstat -aon|findstr "8080" TCP 127.0.0.1:80 0.0.0.0:0 LISTENI ...

随机推荐

  1. 转:ListView中getView的工作原理

    ListView中getView的工作原理: [1]ListView asks adapter “give me a view” (getView) for each item of the list ...

  2. [LeetCode] Search for a Range 二分搜索

    Given a sorted array of integers, find the starting and ending position of a given target value. You ...

  3. List<?>和List<Class<?>>区别及泛型相关

    ?表示是任意类型,但是编译器不能确定他是什么类型,所以你add的时候什么参数也不能传给它Class<?>表示任意类型的Class对象,list里面可以添加任何类型的Class对象,其它的对 ...

  4. python 错误 error: invalid command 'egg_info'

    Processing /bs4-0.0.1/setuptools-38.4.0/numpy-1.14.0    Complete output from command python setup.py ...

  5. Centos下zabbix部署(二)agent安装并设置监控

    1.配置zabbix源 rpm -ivh http://repo.zabbix.com/zabbix/3.0/rhel/7/x86_64/zabbix-release-3.0-1.el7.noarch ...

  6. 中矿大新生赛 A 求解位数和【字符串】

    时间限制:C/C++ 1秒,其他语言2秒空间限制:C/C++ 32768K,其他语言65536K64bit IO Format: %lld 题目描述 给出一个数x,求x的所有位数的和. 输入描述: 第 ...

  7. XML签名

    英文:https://www.javacodegeeks.com/2013/10/xml-security-with-digital-signature-in-java.html 中文:http:// ...

  8. FZU-2268 Cutting Game(二进制使用)

     Problem 2268 Cutting Game Accept: 254    Submit: 605Time Limit: 1000 mSec    Memory Limit : 32768 K ...

  9. 记录git rebase用法

    git 是基于文件系统的版本管理工具,文档和详细介绍可以查看git 一.git commit --amend 如果你对文件做了修改需要和上一次的修改合并为一个change git add . git ...

  10. Requirement Analysis

    BRD:Business Requirements Document,商业需求文档.这是产品声明周期中最早的问的文档,再早就应该是脑中的构思了,其内容涉及市场分析,销售策略,盈利预测等,通常是和老大们 ...