Windows中查找命令的路徑 (類似Linux中的which命令)
Various.
whereis a direct equivalent:C:\Users\Joey>where cmd C:\Windows\System32\cmd.exeNote that in PowerShell
whereitself is an alias forWhere-Object, thus you need to usewhere.exein PowerShell.In
cmdyou can also usefor:C:\Users\Joey>for %x in (powershell.exe) do @echo %~$PATH:x C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exeIn 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\Joey> Get-Command where CommandType Name Definition ----------- ---- ---------- Alias where Where-Object Application where.exe C:\Windows\system32\where.exeThe first returned command is the one that would be executed.
本文由用戶 灬猜想灬 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!