Visual studio Find files that does NOT contain X

前端 未结 4 1835
一向
一向 2021-02-13 14:42

I need a way to list all files that does NOT contain a known text.

The project contains over 1000 files and I only want the ones that does not contain s

4条回答
  •  一生所求
    2021-02-13 15:25

    From a command prompt:

    @for /r %f in (FILE_SPECIFIER) do @find "YOUR_STRING" "%f" > nul || echo %f
    

    For example:

    C:\web-trunk\Views>@for /r %f in (*.cshtml) do @find "Layout" "%f" > nul || echo %f
    
    C:\data\web-trunk\Views\Account\RegisterPartial.cshtml
    C:\data\web-trunk\Views\Admin\SiteInspector.cshtml
    C:\data\web-trunk\Views\CandidateProfile\View.cshtml
    C:\data\web-trunk\Views\Common\ContactFooterForInfoEmails.cshtml
    C:\data\web-trunk\Views\Common\ContactFooterForInfoPages.cshtml
    C:\data\web-trunk\Views\Common\ContactFooterForSalesEmails.cshtml
    C:\data\web-trunk\Views\Common\ContactFooterForSalesPages.cshtml
    

提交回复
热议问题