findstr ms-dos command won't search sub directories

前端 未结 2 1283
囚心锁ツ
囚心锁ツ 2021-02-20 16:43

I had to switch off my windows search indexing in Windows 7 as the old hard disk was constantly making noise with indexing switched on!

Now I want to use Windows

2条回答
  •  别那么骄傲
    2021-02-20 16:50

    You need to put /S at the beginning, i.e.:

    findstr /S "thesis" *.tex
    

    From the built in help:

    C:\>findstr /?
    Searches for strings in files.
    
    FINDSTR [/B] [/E] [/L] [/R] [/S] [/I] [/X] [/V] [/N] [/M] [/O] [/P] [/F:file]
            [/C:string] [/G:file] [/D:dir list] [/A:color attributes] [/OFF[LINE]]
            strings [[drive:][path]filename[ ...]]
    

    Your modifiers/switches, whatever they are called, need to come before your pattern/string

提交回复
热议问题