Linux's netstat command options and OS X(/BSD)'s have almost nothing to do with each other. Of the options you're invoking, only -n means the same on both, and some of the others (-l and -p) have no equivalent on OS X's netstat. What I habitually use on OS X is netstat -an | grep LISTEN, but that doesn't show UDP or the program involved. I suppose you could use netstat -an | egrep '^udp|LISTEN' to include UDP, but that's rather verbose (and you'll also see quite a bit of nonsense UDP stuff, since there isn't really a concept of UDP listening vs. other states). If you need to know the program, you need to go to the lsof (list open files) command, and that requires root access to check processes you don't own. Try something like sudo lsof -nPi -sTCP:LISTEN

 

 

Mac 下netstat和linux下不一样的更多相关文章

  1. 解决Windows下文件在Linux下打开出现乱码的问题

    目录 问题 原理 解决 总结 参考资料 问题 前几天生病了,Java一直在看代码但是没跟着打,于是决定偷一波小小的懒,直接把教材的代码从Windows通过共享文件夹放到了Linux里面.但是编译的时候 ...

  2. windows下plsql连接linux下的oracle数据库

    windows下plsql连接linux下的oracle数据库 经过多方查找,终于找到解决办法,特此记录下来,共享之. PL/SQL Develorper:目前未发现可以在Linux系统中安装的版本. ...

  3. mac mamp环境 和linux下 安装redis 和可视化工具 Redis Desktop Manager

    mac下安装 第一步:安装redis 1. brew install redis 2.启动服务/usr/local/opt/redis/bin/redis-server 3.配置redis密码访问 编 ...

  4. linux下安装python linux下一些常用的命令

    注意 ubuntukylin-14.04.2-desktop-amd64 自带python2.7.6 这个说的比较详细 http://wenku.baidu.com/link?url=gaeFcQrc ...

  5. 记录Window系统下myeclipes连接linux下mysql所出现的一个bug

    记录myeclipes远程连接mysql所出现的一个bug 今天在玩框架hibernate时,出现一个非常费解的bug,话不多说,先看bug Access denied for user 'root' ...

  6. windows下mysql和linux下mysql主从配置

    1. linux下mysql安装版本5.6   windows下mysql版本5.7  不要问我为什么版本不一致  就是想这么搞 2. linux为主服务器   windows为从服务器 3.找到li ...

  7. 20155202 张旭 课下作业: Linux下IPC机制

    20155202张旭 Linux下IPC机制 IPC机制定义 在linux下的多个进程间的通信机制叫做IPC(Inter-Process Communication),它是多个进程之间相互沟通的一种方 ...

  8. win下gvim或者linux下的vim安装vundle都适用的配置文件 - 在当前目录及其子目录下**, 的所有文件* 中, 搜索当前光标所在的单词

    gvim下的普通配置: if v:lang =~ "utf8$" || v:lang =~ "UTF-8$" set fileencodings=utf-8,g ...

  9. Win10下创建virtualenv Linux下创建

    虚拟环境 为什么要搭建虚拟环境 开发多个不同的项目 可能需要用到同一个包不同版本新版本会覆盖旧的 作用 虚拟环境 可以搭建独立的Python运行环境 使项目之间版本不受影响 Linux下如何搭建虚拟环 ...

随机推荐

  1. istio-jaeger-python调用链配置

    虽然,istio ingress controller已经生成了jaeger 记录所需要的信息,但是多个分布式之间没法清晰记录相互之间的依赖关系.所以相关的项目还需要加入特殊配置. 如:python- ...

  2. (转)OOP(面向对象编程)的几大原则

    文章转载自:http://blog.csdn.net/anders_zhuo/article/details/8949566 设计模式遵循的一般原则: 1.开-闭原则(Open-Closed Prin ...

  3. C# 在网页中将Base64编码的字符串显示成图片

    在写一个接口,返回的json里面有图片,是Base64编码的字符串. 测试接口的时候,发现原来在html显示,是直接可以将Base64编码的字符串显示成图片的. 格式如下: <img src=d ...

  4. a label can only be part of statement and a declaratioin is not a statement

    参考资料: https://stackoverflow.com/questions/18496282/why-do-i-get-a-label-can-only-be-part-of-a-statem ...

  5. JavaScript调用wcf服务,并且处理返回的字典集合

    1.第一步创建wcf服务的方法 using System;using System.Collections.Generic;using System.Linq;using System.Runtime ...

  6. maven打包之后为什么class文件中没有注释了?

    <!--生成doc jar包--> <plugin> <groupId>org.apache.maven.plugins</groupId> <a ...

  7. JUC知识点总结图

    转载http://www.jsondream.com/2017/06/12/about-JUC.html

  8. 一道区间DP的水题 -- luogu P2858 [USACO06FEB]奶牛零食Treats for the Cows

    https://www.luogu.org/problemnew/show/P2858 方程很好想,关键我多枚举了一次(不过也没多大关系) #include <bits/stdc++.h> ...

  9. 22.上传app一些相关问题

    1.截取上传的各个屏幕尺寸 1.按最大尺寸截取,快捷键 command+s 2.在模拟器上截取 3. 截图 iphone4 : 640x960 或者 960x640 phone5    640 x 1 ...

  10. oracle undo表空间

    查询undo表空间状态 "Bytes(M)" FROM dba_undo_extents GROUP BY tablespace_name, status; Undo表空间的状态( ...