感谢老师,笔记整理好了,希望可以帮到大家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
4-10位QQ号:^[1-9][0-9]\{3,9\}$
15|18位身份证x:'^[1-9]\([0-9]\{13\}\|[0-9]\{16\}\)[0-9xX]$'
15|18位身份证x:'^[1-9]\([0-9]\{13\}\|[0-9]\{16\}\)[0-9xX]$'
2017-06-12
其他:
头尾字符
^
$
^$ 空行
# 元字符 (普通字符或特殊字符)
\w [A-Za-z0-9]
\W [^A-Za-z0-9]
\b 分割符 例如“:”
头尾字符
^
$
^$ 空行
# 元字符 (普通字符或特殊字符)
\w [A-Za-z0-9]
\W [^A-Za-z0-9]
\b 分割符 例如“:”
2017-06-12