记录一些常用Linux脚本命令,方便调用查看

Shell脚本 Qwluoye 12145℃ 0评论

获取服务器当前请求者的所有IP

netstat -ntu | awk '{print $5}' | cut -d: -f1 | sort | uniq -c | sort -n

查看当前CPU空闲比

top -b -n 1 | grep Cpu | awk '{print $5}' | cut -f 1 -d "."

 

iptables封禁某个IP地址

iptables -I INPUT -s 185.184.220.24 -j DROP

iptables解封某个IP地址

iptables -D INPUT -s 185.184.220.24 -j DROP
喜欢 (5)

文章评论已关闭!