2018年6月25日

邮件发送统计信息

摘要: #!/bin/bash #定义日志路径path=/usr/local/nginx/htdocs/log #生成日期date=`date -d yesterday "+%Y%m%d"` #文件1 file=nciic_check_results.log #文件2file1=id5_check_resu 阅读全文

posted @ 2018-06-25 16:00 我以前不是胖子 阅读(225) 评论(0) 推荐(0) 编辑

统计重复IP并排序

摘要: #降序排列 sort ip20180623.log | uniq -c | sort -rn | more #可以输出到文件哦 sort ip20180623.log | uniq -c | sort -rn >> ip_desc.log #第一个sort先对文件内容排序 #uniq -c 对重复行 阅读全文

posted @ 2018-06-25 10:52 我以前不是胖子 阅读(652) 评论(0) 推荐(0) 编辑

awk截取指定字段

摘要: #!/bin/bash #好多地方可以优化,先记录下,便于以后使用 dir="/logs/$1"file="/logs/$1/requests.log"if [ $1 ];then if [[ ! -d $dir && ! -f $file ]];then echo "$dir is not exi 阅读全文

posted @ 2018-06-25 10:43 我以前不是胖子 阅读(6117) 评论(0) 推荐(0) 编辑

导航