In Linux, the whereis command is a powerful command that may be used to determine the location of executable programs, source or binary files, man pages, and configuration files. It can be simply used as :
Replace with your desired files or man pages.
Table of Contents
- The equivalent of the Whereis command in Windows
However, if you attempt to use the Whereis command in Windows, you will receive an error message stating that the command 'whereis' is not recognized as an internal or external command, operable program, or batch file. mostly due to the fact that Windows lacks this command. Windows is mainly GUI based and you can find them easily but if you want a command version of whereis in Windows then you are in right place.
Ourtechroom will assist you in locating the Windows equivalent of the Whereis command. They are very useful in Windows for locating program executables and configuration files.
The equivalent of the Whereis command in Windows
Let us look few of the equivalents of the Whereis command in windows.
Using gcm command in Powershell
PowerShell is a task automation system that consists of a command-line shell, a scripting language, and a configuration management framework.
You can use the below command which is equivalent to whereis command.
gcm stands for Get-Command.
For demonstration, I am going to the find installation location of python.exe. So I use the below command.
This command will display ApplicationName, Version, Source, and version. Here, the installation location can be found under Source Column.
Using Get-Command in Powershell
Get-Command is also useful command and you can use it as below.
PowerShell's Get-Command Python.exe gets Python.exe's location and properties.
PowerShell searches the system PATH environment variable for the Python.exe executable file and gives the path, version number, module name, and command type.
If PowerShell cannot locate Python.exe, the command will return an error indicating that the command cannot be found.
If you only want to get the Source of the Python installation then type below:
Also, the below command does the same:
Replace Python.exe will your desired application or config file.
Using Where Command in Powershell and Command Line
Where is in fact a standalone application that can be used in both PowerShell and Command-Line. They are not built commands in the Command prompt.
The syntax for Where command looks like this:
where [/R path] [/Q] [/F] [/T] pattern [...]
- /R path indicates the recursive directory or folder.
- /Q only outputs the exit code.
- /F shows only the file's full name.
- /T only shows file change time.the
- pattern defines the file(s) to search.
Open Powershell or the command line and type the below command.
where.exe where python
Replace Python with the desired application or config file.
If you know it is under C: drive and then you can recursively search for the file and get its location. For this type below command.
Using Where Command in Powershell and Command Line for multiple executable files
By separating file names with spaces, the where command can find multiple files. Here we will look how to find notepad.exe and calc.exe at the same time.
Using Environment Variable
If the path of the application is enlisted in Environment Variables then you can use the below command.
$env:path.Split(';') | gci -Filter
Replace with desired application and files.
Here I am going to find out the installation path of the python application shown below.
Using Filter Command
This will perform a recursive search over the contents of the C drive for any files whose names begin with FFmpeg, regardless of the extension of those files. If they are located, then you will see all paths displayed.
dir -path c:\ -filter ffmpeg.* -r
Windows File Explorer search bar works like where. Search for files by name or pattern and select the location. Open File Explorer and type your search word in the top right box.
Where looks for files using their full names, including the extension. For instance, if you typed notepad.exe, it would only look for the file with that name and not for any others that might be called notepad or notepad.dll.
In this way, you can find out What are Whereis commands in Windows. And what is its nearly equivalent command in Windows?