1.netstat -anp |grep 端口号 如下,我以3306为例,netstat -anp |grep 3306(此处备注下,我是以普通用户操作,故加上了sudo,如果是以root用户操作,不用加sudo即可查看),如下图1: 图1 图1中主要看监控状态为LISTEN表示已经被占用,最后一列显示被服务mysqld占用,查看具体端口号,只要有如图这一行就表示被占用了。
查看占用端口8080的进程:netstat -tnlp | grep 8080或lsof -i:8080 查看所有php进程:netstat -anp | grep php | grep ^tcp 查看所有nginx进程:netstat -anp | grep nginx | grep ^tcp 查看80端口连接数最多的20个IP:netstat -anlp|grep 80|grep tcp|awk '{print $5}'|awk -F: '{print $1}'|sor...
12、持续输出 netstat 信息 #netstat -c 13、找出程序运行的端口 #netstat -ap | grep ':80' 14、查看连接某服务端口最多的的IP地址(前20个) #netstat -nat | grep "10.1.62.23:443" |awk '{print $5}'|awk -F: '{print $1}'|sort|uniq -c|sort -nr|head -20 15、TCP各种状态列表 #netstat...
Cloud Studio代码运行 netstat-ap|grep'端口号' 例如: 代码语言:javascript 代码运行次数:0 复制 Cloud Studio代码运行 [root@bogon Test2017_3_7]# netstat-ap|grep'1024'tcp00localhost:1024*:*LISTEN6130/./server tcp00localhost:40312localhost:1024ESTABLISHED6323/./client tcp00localhost:1024localhost:40312ES...
0、不显示别名只显示数字的监听tcp端口在输出中显示 PID 和进程名称 # netstat -nltp 1、列出所有端口 #netstat -a 2、列出所有 tcp 端口 #netstat -at 3、列出所有 udp 端口 #netstat -au 4、只显示监听端口 #netstat -l 5、只列出所有监听 tcp 端口 #netstat -lt ...
查看当前的memcache连接:netstat -n | grep :11211 查看占用端口8080的进程:netstat -tnlp | grep 8080或lsof -i:8080 查看所有php进程:netstat -anp | grep php | grep ^tcp 查看所有nginx进程:netstat -anp | grep nginx | grep ^tcp 查看80端口连接数最多的20个IP:netstat -anlp|grep 80|grep tcp|...