zoukankan      html  css  js  c++  java
  • Windows中查找命令的路径 (类似Linux中的which命令)

    where is a direct equivalent:

    C:UsersJoey>where cmd
    C:WindowsSystem32cmd.exe
    Note that in PowerShell where itself is an alias for Where-Object, thus you need to usewhere.exe in PowerShell.

    In cmd you can also use for:

    C:UsersJoey>for %x in (powershell.exe) do @echo %~$PATH:x
    C:WindowsSystem32WindowsPowerShellv1.0powershell.exe
    In PowerShell you have Get-Command and its alias gcm which does the same if you pass an argument (but also works for aliases, cmdlets and functions in PowerShell):

    PS C:UsersJoey> Get-Command where

    CommandType Name Definition
    ----------- ---- ----------
    Alias where Where-Object
    Application where.exe C:Windowssystem32where.exe
    The first returned command is the one that would be executed.

  • 相关阅读:
    java面向对象第三章
    java基础(9)
    java基础(8)
    java基础(7)
    java基础(6)
    Java(20)file i/o
    Java(19)JDBC
    Java(18) 集合框架
    Java(17)异常
    Java(16)接口
  • 原文地址:https://www.cnblogs.com/johnsonshu/p/5014133.html
Copyright © 2011-2022 走看看