Windows find all files under a directory

3

1

I'm hoping for the Windows Explorer equivalent to Linux's find . type -f.

I did *.* in the search field but it listed directories as well; I wanted just files.

Everything I've found on the subject is talking about finding specific file types, I just want files in general. That is, I want the resulting search listing to consist solely of files of any and all types, no directories/folders.

Mike Dannyboy

Posted 2017-05-15T23:22:14.510

Reputation: 55

is a command feasible? or must it be GUI? – phuclv – 2017-06-12T03:26:47.380

Answers

4

I want the resulting search listing to consist solely of files

Use *.* NOT kind:folder

Notes:

  • NOT must be spelled with capital letters.

  • Using a filter such as .** or .? as specified in another answer doesn't work if the location isn't indexed.

Examples

No filter:

enter image description here

*.* NOT kind:folder filter:

enter image description here


Further Reading

DavidPostill

Posted 2017-05-15T23:22:14.510

Reputation: 118 938

Per your "Advanced Query Syntax" URL you can make use of boolean operators, so how about *.* NOT kind:folder? Essentially the same thing except it excludes folders. Seems to work for me on Windows 10. – BrianC – 2017-05-16T02:05:57.570

@BrianC Yes, that works. Well spotted. I tried before with not not realising it had to be NOT :/ Answer updated. – DavidPostill – 2017-05-16T07:43:07.267

0

Short Answer: Use .** or .?


I figured this out by randomly trying things :). Just type in .**, and voila!

Edit #1: I just found out that .? works too

explorer I'm not really sure why this works, so if anyone figures it out please edit :)

Edit #2: I think it has something to do with how * matches tons of symbols, and ? just matches one letter or symbol. But, I'm surprised that .** matches test.c since it only has one character in the path.

"the question mark is used to substitute for one letter or symbol that you don't know. The asterisk is used to substitute for many letters and symbols" (http://www.digitalcitizen.life/basics-making-advanced-searches-wildcards-and-filters)

I'm not really 100% sure why it works, so it might have some unexpected results. But, so far both work for all the files I have tested, including ones with a single character as an extension (test.c)

Noah Cristino

Posted 2017-05-15T23:22:14.510

Reputation: 168

.** and .? don't work if the location being search is not indexed. – DavidPostill – 2017-05-15T23:49:09.973

@DavidPostill It works for me, and I didn't need to index. – Noah Cristino – 2017-05-16T00:03:27.620

Hmm. Maybe that's a Windows 7 thing. – DavidPostill – 2017-05-16T00:04:24.833

@DavidPostill Probably just an issue with the horrible Windows XP search xD – Noah Cristino – 2017-05-16T00:06:18.830

? matches one char. Asterisk matches zero or more chars. – ddbug – 2017-05-16T01:53:05.970

One problem with this: If you have a file with no extension at the end of it, it won't show up. – BrianC – 2017-05-16T02:21:46.893

doesn't work in Windows 10. It gives me all files and folders. Edit: it seems to work when I tried in an indexed folder – phuclv – 2017-06-12T03:19:24.827