Forrest logo
back to the where tool

where:tldr:77663

where: Recursively search for file pattern at specified path.
$ where /R ${path\to\directory} ${file_pattern}
try on your machine

The command "where /R ${path\to\directory} ${file_pattern}" is a command used in the Windows command prompt or PowerShell to search for files that match a specific pattern within a specified directory and its subdirectories.

Here's a breakdown of the command:

  • "where" is the command itself, which is used to search for files.

  • "/R" is an option that specifies recursive search, meaning it will search not only in the specified directory but also in all of its subdirectories.

  • "${path\to\directory}" is the placeholder for the path to the directory in which you want to search for files. You need to replace this placeholder with the actual path to the directory.

  • "${file_pattern}" is the placeholder for the pattern that specifies the files you want to search for. You need to replace this placeholder with the actual file pattern, such as ".txt" to search for all text files or "file.jpg" to search for files starting with "file" and having a ".jpg" extension.

For example, if you want to search for all text files within the "C:\Documents" directory and its subdirectories, the command will be: "where /R C:\Documents *.txt"

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the where tool