linux如何查看端口被谁占用
linux-dash
A beautiful web dashboard for Linux
项目地址:https://gitcode.com/gh_mirrors/li/linux-dash

·
原文地址:http://www.blogjava.net/kxx129/archive/2013/05/13/399206.html
使用 netstat 进行查看!
>netstat -noap | grep 80 | grep tcp
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
-----------------------------------------------------------------------------------------------------------------
tcp 74160 138880 127.0.0.1:6150 127.0.0.1:6150 ESTABLISHED 3145/tnslsnr unkn-4 (52.04/0/0)
tcp 0 0 :::8009 :::* LISTEN 31550/java off (0.00/0/0)
tcp 0 0 :::8080 :::* LISTEN 31550/java off (0.00/0/0)
tcp 0 0 :::80 :::* LISTEN 24675/httpd off (0.00/0/0)
…
使用 lsof 进行查看!
谁在使用tcp8080端口
>/usr/sbin/lsof -i tcp:8080
COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME
------------------------------------------------------
java 31550 root 109u IPv6 78687600 TCP *:webcache (LISTEN)
谁在使用22端口
>/usr/sbin/lsof -i :22
COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME
sshd 2883 root 3u IPv6 7642 TCP *:ssh (LISTEN)
>/usr/sbin/lsof -i | grep http
>/usr/sbin/lsof -i | grep http
uselib24 15272 apache 4u IPv6 217212 TCP *:http (LISTEN)
uselib24 15272 apache 6u IPv6 217217 TCP *:https (LISTEN)
uselib24 15272 apache 6u IPv6 217217 TCP *:https (LISTEN)




A beautiful web dashboard for Linux
最近提交(Master分支:6 个月前 )
186a802e
added ecosystem file for PM2 4 年前
5def40a3
Add host customization support for the NodeJS version 4 年前
更多推荐
所有评论(0)