1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

FFIND /S, find directory with specified name?

Discussion in 'Support' started by vefatica, Oct 10, 2014.

  1. vefatica

    Joined:
    May 20, 2008
    Messages:
    8,058
    Likes Received:
    30
    How can I get FFIND /S to find a directory with a specified name (and only directories with that specified name)? Below, how do I find "g:\tc17" only?
    Code:
    v:\> ffind /s /a:d g:\tc17
    G:\tc17\plugins
    G:\tc17\Styles
    
      2 files
    
    v:\> ffind /s /a:d g:\tc17*
    G:\tc17
    G:\tc177
    
      2 files
     
  2. Charles Dye

    Charles Dye Super Moderator
    Staff Member

    Joined:
    May 20, 2008
    Messages:
    3,352
    Likes Received:
    39
    How about FFIND /S /A:D G:\TC1[7]
     
  3. vefatica

    Joined:
    May 20, 2008
    Messages:
    8,058
    Likes Received:
    30
    Yeah, that works but it's quite a kludge to handle the simplest case in which I know exactly the name of what I'm looking for.
     
  4. Charles Dye

    Charles Dye Super Moderator
    Staff Member

    Joined:
    May 20, 2008
    Messages:
    3,352
    Likes Received:
    39
    You can also slap the brackets on the end: TC17[]
     
  5. vefatica

    Joined:
    May 20, 2008
    Messages:
    8,058
    Likes Received:
    30
    Same comment.
     
  6. Charles Dye

    Charles Dye Super Moderator
    Staff Member

    Joined:
    May 20, 2008
    Messages:
    3,352
    Likes Received:
    39
    I can't claim elegance. But if you want to specify a directory name to search for -- as opposed to a directory name to search in -- I think you must use a wildcard. And if you want a wildspec which can only match one specific filename, then the square brackets it is.
     
  7. mikea

    Joined:
    Dec 7, 2009
    Messages:
    213
    Likes Received:
    2
    I thought my old standby — using “.” by itself at the end of a filename or directory name — would do the trick. As in: ffind /s /a:d c:\tc17.

    Nope. But this did. Go figure:

    ffind /s /a:d c:\tc17.*

    I’d created c:\tc17 and c:\tc177. The command returned only c:\tc17 and not c:\tc177.
     
  8. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    10,022
    Likes Received:
    84
    If you want to search for files (and not their contents), then DIR or PDIR will be faster than FFIND.
     

Share This Page