感谢老师,笔记整理好了,希望可以帮到大家http://blog.csdn.net/zziazero/article/details/73543193#t0
2017-06-21
netstat -anp | awk '/STREAM/{a[$6]+=1} END {for (i in a) printf("The stream is %10s,count is %5d\n", i, a[i])}'
2017-06-21
实验证明,不用加BEGIN也可以。
awk -F ':' '$1!~/^$/{count+=1} END {printf("The users count is %s\n", count )}' /etc/passwd
awk -F ':' '$1!~/^$/{count+=1} END {printf("The users count is %s\n", count )}' /etc/passwd
2017-06-21
awk -F ':' 'BEGIN {count=0} $1!~/^$/{count+=1} END {printf("The users count ics %s\n", count )}' /etc/passwd
2017-06-21
awk '{a[$1]+=1} END {for (i in a) printf("%10s %5d\n",i,a[i])}' www.***.com_access.log | sort
2017-06-20