23

I need find a file in Windows under command line, but receive results as a table. Similar to windowed version of find, where we have last column, displaying location.

dir /s doesn't match this requirement, because it enters each directory and reports this in separate header, leaving file list as usual.

Dims
  • 12,244
  • 78
  • 161
  • 252

3 Answers3

37

You can use where.exe

where /r c:\windows ntoskrnl.exe

or, with wildcards:

where /r c:\windows ntoskr*
whiskeychief
  • 238
  • 1
  • 16
Axel Rietschin
  • 471
  • 4
  • 4
  • 3
    This is an excellent solution. I have used Windows' `where` as Unix `which` equivalent for a long time, but I did not know until now that is also (somewhat) capable to replace `find` . – jschreiner Nov 19 '20 at 15:43
20

If the headers are the only problem in your case, use the /B switch.

dir filename.ext /S /B

A list of all files matching the filename along with their location is printed.

Pradeep
  • 301
  • 2
  • 5
-1

dir filename.* /S /B

Finds all the matches for the string filename. Displays src and include files