Find Files
Use the following native commands to find files or their content on Windows.
Find Files
cmd.exe
dir /b /s C:\[filename]
[filename]
supports the*
wildcard- Replace
C:\
by another directory to restrict the search to this directory and below
PowerShell
ls -r C:\ [filename] 2>$null | % { echo $_.fullname }
[filename]
supports the*
wildcard- Replace
C:\
by another directory to restrict the search to this directory and below
Tip
Use gc $_.fullname
instead of echo $_.fullname
to display the content of each file found.
Find Content
Find all files containing a specific pattern.
cmd.exe
findstr /N /S /I "[pattern]" \path\to\base\dir\supporting\*.ext
PowerShell
ls -r C:\ | % { Select-String -Path $_ -Pattern [pattern] } 2>$null