grep 用法(在文件列表中找到包含指定字符的文件名称)

1.在所在目录下查找包含temporary关键字的sh脚本

grep -i "temporary" *sh |awk -F ":" '{print $1}'|sort |uniq

2.grep常用参数(待补充)

不区分大小写
grep -i 'a'
反向查找不包含
grep -v 'a'
查找多个关键字
grep -E 'a|b'

参考

https://blog.csdn.net/fanxianchao_2012/article/details/109879554

posted @ 2022-06-09 15:07  whiteY  阅读(57)  评论(0)    收藏  举报