mrbrooks
V2EX  ›  macOS

mac 里什么什么命令能达到linux的这个效果(netstat -tunlp)

  •  
  •   mrbrooks · Jun 6, 2013 · 17058 views
    This topic created in 4726 days ago, the information mentioned may be changed or developed.
    mac 里什么什么命令能达到linux的这个效果(netstat -tunlp),列出正在监听的所有端口。

    # netstat -tunlp
    Active Internet connections (only servers)
    Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
    tcp 0 0 0.0.0.0:11111 0.0.0.0:* LISTEN 4866/ricci
    tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 23940/mysqld
    tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 29702/sshd
    tcp 0 0 :::22 :::* LISTEN 29702/sshd
    2 replies    1970-01-01 08:00:00 +08:00
    keepzero
        1
    keepzero  
       Jun 7, 2013   ❤️ 1
    netstat -anL
    lululau
        2
    lululau  
       Jun 7, 2013
    lsof -ni | grep LISTEN
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   938 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 92ms · UTC 19:21 · PVG 03:21 · LAX 12:21 · JFK 15:21
    ♥ Do have faith in what you're doing.