• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • VCS
  • Interview Questions
  • Database
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

What is an equivalent of which on the Windows command line?

by admin

On the Windows command line, the equivalent of the Linux/Unix “which” command is the “where” command. The “where” command can be used to locate the path of an executable file that is specified in the command line.

For example, if you want to find the path of the “java” executable, you can run the following command:

where java

This will display the full path of the “java” executable file, if it exists in any of the directories that are listed in the system’s PATH environment variable. If the executable file is not found, then the command will not return any output.

The “where” command can also be used with wildcards to search for files that match a specific pattern. For example, to find all executable files that start with the letter “p”, you can run the following command:

where p*.exe

This will display the full path of all executable files that match the pattern “p*.exe”.

Examples

1. Find all files named ‘Zappa’ on the remote computer ‘Server64’ by searching the subdirectories of Share1:

C:\> WHERE /r \\Server64\Share1 Zappa.*

2. List all the files in the Demo folder:

C:\> WHERE "C:\demo\:*.*"

3. List all the .CSV files on both the work and play folders:

C:\> WHERE C:\work\;C:\Play\:*.csv

4. In PowerShell, find all copies of robocopy.exe in the current system path:

PS C:\> WHERE.exe robocopy.exe

Summary

The “where” command in Windows is a command-line utility that helps you locate the path of an executable file that matches the name you specify. It is similar to the Linux/Unix “which” command.

Filed Under: Linux, Windows

Some more articles you might also be interested in …

  1. mix Command Examples
  2. fc: Open the most recent command and edit it
  3. middleman Command Examples
  4. less: command not found
  5. gow Command Examples
  6. “az tag” Command Examples (Manage tags on a resource)
  7. jcal Command Examples
  8. grafana-cli Command Examples
  9. btrfs inspect-internal Command Examples in Linux
  10. How to Trace Python Scripts using trace.py

You May Also Like

Primary Sidebar

Recent Posts

  • Vanilla OS 2 Released: A New Era for Linux Enthusiasts
  • mk Command Examples
  • mixxx Command Examples
  • mix Command Examples

© 2025 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright