ffind and directories

  • This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.
I thought that

ffind /a:d /s Foo

would let me find all directories named "Foo", but it doesn't seem to always do that. Can anyone explain the results below? I find them inexplicable. E.g., why should searching for "Foo*" find Foo, but searching for "Foo" doesn't?


Volume in drive C is OS Serial number is 1ce5:1203
Directory of C:\Junk\*

3/05/2010 12:45p DIR .
3/05/2010 12:45p DIR ..
0 bytes in 0 files and 2 dirs
205,416,271,872 bytes free

C:\Junk>mkdir Foo

C:\Junk>ffind /a:d foo

0 files

C:\Junk>ffind /a:d foo*

1 file

C:\Junk>mkdir Foo\Bar

C:\Junk>ffind /a:d /s bar

1 file

C:\Junk>mkdir Foo\Aaa

C:\Junk>ffind /a:d /s bar

1 file

C:\Junk>ffind /a:d /s bar*

1 file


C:\Junk\Foo>ffind /a:d bar

0 files

C:\Junk\Foo>ffind /a:d /s bar

0 files


Volume in drive C is OS Serial number is 1ce5:1203
Directory of C:\Junk\Foo\*

3/05/2010 12:46p DIR .
3/05/2010 12:46p DIR ..
3/05/2010 12:46p DIR Aaa
3/05/2010 12:46p DIR Bar
0 bytes in 0 files and 4 dirs
205,416,271,872 bytes free

C:\Junk\Foo>ffind /a:d /s bar*

1 file

C:\Junk\Foo>ver /r

TCC 11.00.40 Windows Vista [Version 6.0.6002]
TCC Build 40 Windows Vista Build 6002 Service Pack 2
Registered to davidmarcus - 1 System License

Charles Dye

Super Moderator
Staff member
May 20, 2008
Albuquerque, NM
I think what's happening is that, if your argument names a directory (either in the current directory, or fully qualified), then FFIND automatically appends a \* for you. So, if you have a subdirectory named FOO within the current directory, then FFIND FOO works out the same as FFIND FOO\* -- list all matching items within FOO. (BAR and AAA in your example; try it.)

Using wildcards prevents the argument from matching a specific directory name; FFIND FOO* can't search within the FOO* directory, because there is no such directory. You might not want the asterisk, since it would also match FOODPOISONING and FOOLONTHEHILL and you don't care about them. A more specific wildcard such as FO[O] or FOO[] will match only FOO and not those others -- I suspect this is what you really want.

Or maybe it's just your own darn fault for using protomatter in the Genesis matrix.