filesystemsfull-text-search

Searching for specific string in a folder system


So I have a folder system in Windows with a bunch of files with php. I am trying to find all the times a specific string/variable is used in the files but I dont want to go through each file and CTR-F for said variable. Is there a way to do something similar to CTR-F for the variable on all the files at the same time and have windows return every file it is mentioned?

Ive found an advances query system for windows but it mostly helps with determining scope and type of files, but nothing else. I have also seen about using network driver but the solution Im looking for would be inside Windows search system.


Solution

  • Windows tooling is not great for this, but if you use WSL, you can execute a find + grep very easily:

    > find . -name '*.php' -exec grep -l "your-variable-name" {} +
    

    Alternately, if you're using an IDE tool like VS Code or PHPStorm, you can use the "find in multiple files" features.