# netstat \[-anp] \[| grep 端口号] **略过时,推荐使用ss(同参数)** 作用:查看端口的占用情况 参数: - a:所有端口 - n:以数字显示 - p:显示进程PID和名称 示例: - netstat -anp | grep 80