-
whereis a direct equivalent in cmd: where gccC:\Users\Administrator> where gcc D:\msys64\mingw64\bin\gcc.exeNote that in PowerShell
whereitself is an alias forWhere-Object, thus you need to usewhere.exein PowerShell. -
In >
cmdyou can also use : for %x in (gcc.exe) do @echo %~$PATH:xC:\Users\Administrator> for %x in (gcc.exe) do @echo %~$PATH:x D:\msys64\mingw64\bin\gcc.exe -
In > PowerShell you have
Get-Commandand its aliasgcmwhich does the same if you pass an argument (but also works for aliases, cmdlets and functions in PowerShell):PS C:\Users\Administrator> Get-Command gcc CommandType Name Version Source ----------- ---- ------- ------ Application gcc.exe 0.0.0.0 D:\msys64\mingw64\bin\gcc.exeThe first returned command is the one that would be executed.
Windows中查找命令的路径 (类似Linux中的which命令)
于 2024-09-05 14:58:36 首次发布
807

被折叠的 条评论
为什么被折叠?



