netstat
<h1>查看本机所有启动的端口号</h1>
<p><strong>linux</strong>
netstat -antpl
<img src="https://www.showdoc.cc/server/api/common/visitfile/sign/e7f980200fbd257d39a5f80dbe2be14c?showdoc=.jpg" alt="" />
<strong>windows</strong>
netstat -an
<img src="https://www.showdoc.cc/server/api/common/visitfile/sign/a8dc7cf48c6e02eb44410d8ef0735152?showdoc=.jpg" alt="" /></p>
<h1>查看某个端口启动状态</h1>
<p><strong>linux</strong>
netstat -antpl|grep "22"
<img src="https://www.showdoc.cc/server/api/common/visitfile/sign/85c822a3af7ebfdb3f4371192c02be03?showdoc=.jpg" alt="" />
<strong>windows</strong>
netstat -an |findstr “135”
<img src="https://www.showdoc.cc/server/api/common/visitfile/sign/83a820713337715869ce756b533bfb65?showdoc=.jpg" alt="" /></p>