ufo22940268
V2EX  ›  问与答

mac os 下怎么列出进程名字和端口号

  •  
  •   ufo22940268 · Aug 1, 2014 · 6797 views
    This topic created in 4313 days ago, the information mentioned may be changed or developed.
    linux下我一直用netstat -ntlp来完成这个功能,但是mac os下不行。去网上查了之后lsof -i | grep LISTEN能做到一部分,但是貌似不能列出所有进程
    3 replies    2014-08-01 12:22:47 +08:00
    yangg
        1
    yangg  
       Aug 1, 2014 via Android   ❤️ 1
    不是全部什么意思?加sudo?
    ufo22940268
        2
    ufo22940268  
    OP
       Aug 1, 2014
    @yangg 好像是的。但是我有另外一个问题,不知道为什么有些进程显示的不是端口号,比如Charles 1115 ccheng 56u IPv6 0x5e13e897b20c9df5 0t0 TCP *:distinct (LISTEN)
    randal
        3
    randal  
       Aug 1, 2014
    -P, 不行就man看下
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2939 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 122ms · UTC 08:00 · PVG 16:00 · LAX 01:00 · JFK 04:00
    ♥ Do have faith in what you're doing.