Wednesday, January 15, 2025
HomeTechIs there an equivalent of 'which' on the Windows command?

Is there an equivalent of ‘which’ on the Windows command?

Yes, Windows does not have a direct equivalent of the Unix/Linux which command, but you can use other methods to find the path of an executable file.

Methods to Find Executable Paths in Windows

  1. Using where Command
    The where command in Windows can locate executable files:

    bash
    where command_name

    Example:

    bash
    where python

    This will return the path of Python if it’s installed.

  2. Using which Command in Git Bash
    If you have Git Bash installed on Windows, you can use the which command to find executables:

    bash
    which command_name
  3. Using PowerShell
    PowerShell provides a similar command with additional flexibility:

    powershell
    Get-Command command_name

    Example:

    powershell
    Get-Command python

This will display the path of the Python executable.

These methods will help you locate executables on a Windows system.

RELATED ARTICLES
0 0 votes
Article Rating

Leave a Reply

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
- Advertisment -

Most Popular

Recent Comments

0
Would love your thoughts, please comment.x
()
x