Linux netstat 命令

netstat

netstat

通过进程查看占用端口

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# netstat -nap | grep 9836
$ netstat -anp | grep <pid>
tcp 0 0 0.0.0.0:8880 0.0.0.0:* LISTEN 15910/java
tcp 0 0 0.0.0.0:8881 0.0.0.0:* LISTEN 20854/java
tcp 0 0 0.0.0.0:8883 0.0.0.0:* LISTEN 18394/docker-proxy
tcp6 0 0 :::8883 :::* LISTEN 18400/docker-proxy
unix 2 [ ACC ] STREAM LISTENING 230283 17888/containerd-sh /run/containerd/s/f54f5c6b3963ea8fcec7d3c2baefa7fcb70884d50299148a00d747cc3c59980d
unix 3 [ ] STREAM CONNECTED 234595 17888/containerd-sh
unix 3 [ ] STREAM CONNECTED 229049 17888/containerd-sh /run/containerd/s/f54f5c6b3963ea8fcec7d3c2baefa7fcb70884d50299148a00d747cc3c59980d

$ netstat -anl|grep 888
tcp 0 0 0.0.0.0:8880 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:8881 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:8883 0.0.0.0:* LISTEN
tcp6 0 0 :::8883 :::* LISTEN
  • 本文作者: forever杨
  • 本文链接: https://blog.yl-online.top/posts/6c05ba39.html
  • 版权声明: 本博客所有文章除特别声明外,均采用 BY-NC-SA 许可协议。如果文章内容对你有用,请记录到你的笔记中。本博客站点随时会停止服务,请不要收藏、转载!