How can I grep hidden files?

前端 未结 10 1212
北荒
北荒 2020-12-07 14:27

I am searching through a Git repository and would like to include the .git folder.

grep does not include this folder if I run



        
10条回答
  •  有刺的猬
    2020-12-07 14:58

    You can also search for specific types of hidden files like so for hidden directory files:

    grep -r --include=*.directory "search-string"
    

    This may work better than some of the other options. The other options that worked can be too slow.

提交回复
热议问题