AWK的使用方法

 cat maillog |grep size= |awk '{print $8}'  |awk -F= '{print $2}' |awk -F , '{print $1}' |awk '{sum+=$1}END{print sum}'

DE=`date --date="1 days ago" | awk '{printf("%3s%3s\n", $2,$3)}'`
cat /var/log/maillog |grep "$DA" | grep -E "baidu.com|google.com"  |grep -E "http|fully-qualified" |cut -f1,2,3,20- -d" " |awk -F proto= '{print $1}' |sed 's/$/\r\n/g' 

http://hi.baidu.com/laq007/item/bc8ba901a292c8e7f45ba609?qq-pf-to=pcqq.c2c



你可能感兴趣的:(shell,awk)