linux awk命令忽略大小写

linux awk忽略大小写

root@DESKTOP-1N42TVH:/home/test# ls
test.txt
root@DESKTOP-1N42TVH:/home/test# cat test.txt
a 3 d
Q 1 j
z c m
q e i
3 4 Q
A f 3
root@DESKTOP-1N42TVH:/home/test# awk '/q/' test.txt   ## 提取匹配q的行
q e i
root@DESKTOP-1N42TVH:/home/test# awk 'BEGIN{IGNORECASE=1} /q/' test.txt  ## 忽略大小写匹配
Q 1 j
q e i
3 4 Q

 

posted @ 2022-01-03 12:34  小鲨鱼2018  阅读(1158)  评论(0编辑  收藏  举报