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 <Command> with your desired files or man pages.
Table of Contents
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 equivalent 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 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.
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 build commands in Command prompt.
Open Powershell or CommandLine 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 Environment Variable
If the path of application is enlisted in Environment Variables then you can use the below command.
$env:path.Split(';') | gci -Filter <Command>
Replace <Command> 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
In this way, you can find out What are Whereis commands in Windows. And what is its nearly equivalent command in Windows?