grep only text files

前端 未结 3 825
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-30 19:58
find . -type f | xargs file | grep text | cut -d\':\' -f1 | xargs grep -l \"TEXTSEARCH\" {}

it\'s a good solution? for find TEXTSEARCH recursively in o

3条回答
  •  孤独总比滥情好
    2021-01-30 20:20

    If you know what the file extension is that you want to search, then a very simple way to search all *.txt files from the current dir, recursively through all subdirs, case insensitive:

    grep -ri --include=*.txt "sometext" *

提交回复
热议问题