常用命令备忘

http接数排序

netstat -anlp|grep 80|grep tcp|awk '{print $5}'|awk -F: '{print $1}'|sort|uniq -c|sort -nr|head -n20 | netstat -ant |awk '/:80/{split($5,ip,":");++A[ip[1]]}END{for(i in A) print A[i],i}' |sort -rn| head -n20
tcpdump -i eth1 -tnn dst port 80 -c 1000 | awk -F"." '{print $1"."$2"."$3"."$4}' | sort | uniq -c | sort -nr |head -20 

连接状况,按状态分类统计

netstat -n | awk '/^tcp/ {++S[$NF]} END {for(a in S) print a, S[a]}'

MYSQL binlog转换

mysqlbinlog --database=dbname --set-charset=utf8 --start-datetime="2015-7-19 00:00:00" --stop-datetime="2015-6-20 23:59:59" mysql-bin.000109 mysql-bin.000110 > mysql-bin-log

通过innode删除文件

ls -i 
find . -inum 377332 -exec rm -i {} ;

本文持续更新中。。。

原文地址:https://www.cnblogs.com/ddcoder/p/5805401.html