• Mac 下netstat和linux下不一样


    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

     

     
  • 相关阅读:
    FreeNAS的安装使用记录
    slackware中配置命令行下的分辨率
    创建类的理由
    软件开发人员的入门级书单
    Pow(x, n)
    Group Anagrams
    Rotate Image
    Permutations
    Multiply Strings
    Combination Sum II
  • 原文地址:https://www.cnblogs.com/zhaoxinshanwei/p/8696755.html
Copyright © 2020-2023  润新知