一、简介

 

二、教程

1)高级教程

 

三、实例

1)过滤字符(对大小写很敏感)

dir -l | awk '$3=="root" {print $1,$3,$4, $9;} ' 
cat tecmint_deals.txt | awk '$4 ~ /Tech/{print}'

2)使用shell变量

cat /etc/passwd | awk "/$username/ "' { print $0 }'
cat /etc/passwd | awk -v name="$username" ' $0 ~ name {print $0}'

3)统计排序

awk -F "" '{for (i=1;i<=NF;i++) print $i }' test.log|sort|uniq -c

相关文章:

  • 2021-09-01
  • 2021-12-12
  • 2021-10-01
猜你喜欢
  • 2021-04-24
  • 2022-01-21
  • 2021-09-21
  • 2021-11-30
  • 2021-11-08
相关资源
相似解决方案