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. 5E - A + B Again

    There must be many A + B problems in our HDOJ , now a new one is coming. Give you two hexadecimal in ...

  2. C# 关闭进程的时候总是捕捉到System.Threading.ThreadAbortException: 正在中止线程

    C# 关闭进程的时候总是捕捉到System.Threading.ThreadAbortException: 正在中止线程 这是由ThreadAbortException抛出的 可以写成下面的样子 tr ...

  3. ES6解构赋值的应用场景

    一.变量交换 1.ES6的方式 { let a=; let b=; [a,b]=[b,a]; console.log(a,b); } 输出为 2.ES5的方式 采用中间变量的方式进行存储 二.获取函数 ...

  4. hdu 2289 要二分的杯子

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2289 大意是 一个Cup,圆台形,给你它的顶部圆的半径,底部圆的半径,杯子的高度,和此时里面装的水的体 ...

  5. hdu 1757 (矩阵快速幂) 一个简单的问题 一个简单的开始

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1757 题意不难理解,当x小于10的时候,数列f(x)=x,当x大于等于10的时候f(x) = a0 * ...

  6. Android.FamousBlogs

    1. cyrilmottier http://cyrilmottier.com/ http://cyrilmottier.com/about/ 2. greenrobot http://greenro ...

  7. Eclipse.Error.gen already exists but is not a source folder.

    在Eclipse ADT来开发Android App时会遇到以下问题:"myproject/gen already exists but is not a source folder. Co ...

  8. BZOJ1178或洛谷3626 [APIO2009]会议中心

    BZOJ原题链接 洛谷原题链接 第一个问题是经典的最多不相交区间问题,用贪心即可解决. 主要问题是第二个,求最小字典序的方案. 我们可以尝试从\(1\to n\)扫一遍所有区间,按顺序对每一个不会使答 ...

  9. pop回到之前的某一个页面

    循环遍历 - (void)backHome:(UIButton *)button { self.navigationController.navigationBarHidden = NO; 4 Cas ...

  10. tiny cc 编译器,tinycc,变种

    去掉了 -run 参数 下载代码和编译好的程序