What are the undocumented features and limitations of the Windows FINDSTR command?

后端 未结 8 1734
耶瑟儿~
耶瑟儿~ 2020-11-21 04:23

The Windows FINDSTR command is horribly documented. There is very basic command line help available through FINDSTR /?, or HELP FINDSTR, but it is

8条回答
  •  我寻月下人不归
    2020-11-21 05:23

    /D tip for multiple directories: put your directory list before the search string. These all work:

    findstr /D:dir1;dir2 "searchString" *.*
    findstr /D:"dir1;dir2" "searchString" *.*
    findstr /D:"\path\dir1\;\path\dir2\" "searchString" *.*
    

    As expected, the path is relative to location if you don't start the directories with \. Surrounding the path with " is optional if there are no spaces in the directory names. The ending \ is optional. The output of location will include whatever path you give it. It will work with or without surrounding the directory list with ".

提交回复
热议问题