I want to know the full path of a script/executable which is executed when I enter a command in (Anaconda) prompt.
When I type
where conda
I get three results
C:\ProgramData\Anaconda3\Library\bin\conda.bat
C:\ProgramData\Anaconda3\Scripts\conda.exe
C:\ProgramData\Anaconda3\condabin\conda.bat
I thought I could narrow it down with
where "$path:conda"
But I got the same result.
Which of these three is actually executed when e.g. I run conda list
?
Best Answer
The path variable stores paths defined by systems, programs and/or the user
This variable can be edited and paths can be added by the programs during the installation process, or also added by the user manually, but by itself it aims to facilitate that the software components are used / found.
When a command is executed, the system will try to execute it using the current folder, when it does not match, then it will go through each of the defined paths and obeying the order of occurrences delimiter by delimiter
;
and will immediately run on the first match found, and only that one.To find a file by searching in the current folder and all path defined in the path variable:
To find a file by searching all paths defined in the path variable but not in the current folder:
To find a file by searching only in the current folder without searching the path variable:
To find a file by searching the current folder and all its subfolders:
To search for a file in a folder just specify:
To search for a file in only two folders (or more)
To find a file by searching the current drive and all of its subfolders:
Obs.: 1 If you want all extensions, remove .ext
Obs.: 2 If the file has no spaces in the name and/or special characters, you can use it without double quotes:
Obs.: 3 Do not use \ at the end of the folder name, where you don't like this character at the end:
Obs.: 4 Where can be used to find files length defined in the file name, where each
?
==1
character:Some further reading:
[√] Where
[√] Where /ss64.com