osx 查看端口

Submitted by lepton on Wed, 11/21/2018 - 11:06

a. `netstat -nat | grep <端口号>` , 如命令 `netstat -nat | grep 3306`

b. `netstat -nat |grep LISTEN`

c lsof -n -P -i TCP -s TCP:LISTEN

d lsof -i:port

e telnet ip port

Add new comment

Restricted HTML

  • Allowed HTML tags: <a href hreflang> <em> <strong> <cite> <blockquote cite> <code> <ul type> <ol start type> <li> <dl> <dt> <dd> <h2 id> <h3 id> <h4 id> <h5 id> <h6 id>
  • Lines and paragraphs break automatically.
  • Web page addresses and email addresses turn into links automatically.