Search for "either or"

Discussion in 'OS X Mavericks (10.9)' started by dberch1956, Mar 10, 2015.

  1. dberch1956 macrumors newbie

    Jan 2, 2010
    Greetings. I'd like to be able to find the following on my mac...

    All images that have ...
    the text "David" OR the text "dberch" OR the text "berchtold"

    How do I do that?

  2. Sumleilmus macrumors member


    Nov 6, 2011
    get regular expression

    Open a Terminal shell and at the prompt type
    man grep

    I know enough to point you in this direction, but not enough to be more help than that. Usually the space bar will move the page down as you read.

    Many UNIX books for Mac OS will explain the command, possibly in a way you will find more congenial.
  3. chown33 macrumors 604

    Aug 9, 2009
    Create a "composite" search item using "Find..." or "New Smart Folder" in Finder.

    First, open the Find window or a New Smart Folder.

    Then add a "Kind" is "Image" search item.

    Next, hold down the OPTION key and click the round + button. It should add what I call a "composite" item, which lets you choose:
    (Any/All/None) of the following are true

    Set the popup to "Any" (its default).

    Now, below and indented will be one default search item, which you can change to search for your first name of interest. Then click its round + button, and another item will be added under the composite. Change it to match your second name. Repeat again for the third name.

    I call this a composite item because it's composed of subsearch items. I only recently learned of it, so it may have an official name I'm unaware of.
  4. dberch1956, Mar 12, 2015
    Last edited: Mar 12, 2015

    dberch1956 thread starter macrumors newbie

    Jan 2, 2010
    Thanks, Chown33. I'm trying to follow your instructions and I must be really thick.

    1) "Any" is the default for "of the following are true," so I'm not sure why I need to do that.

    2) When I do a find on "dberch" it shows me boatloads of stuff that does NOT contain dberch. See attached pic. What is going on please? is Search Broken? Sure looks like it.

    3) If i have any chance at all of following your instructions, i'll need pictures showing each step. Is that too much to ask? I understand if it is...

    4) in your instruction: "Then click its round + button, and another item will be added under the composite. Change it to match your second name. Repeat again for the third name." There is no place to enter search text. except the original search text at top right of the dialog. Is that what you mean?

    5) as soon as you hit Option, there is no + button it changes to "...". This type of error makes following your instructions really confusing. Please try to be clear.

    I am a UI Designer by trade. This is the most frustrating thing I've seen in months. Why the HELL can't I just type AND or OR in the search text??? I feel better now. a little. :)



    Attached Files:

  5. kaibob, Mar 12, 2015
    Last edited: Mar 14, 2015

    kaibob macrumors regular

    Jun 21, 2010
    Prescott, Arizona
    I suspect the OP is looking for a solution with a GUI, which allows matching files to be easily copied, moved, and otherwise manipulated. But, if not, the commandline included below will do what he wants and is easily run by pasting it into a terminal window.

    As written, the search directory is the user's home directory. This can be changed by removing "~" and substituting a path, such as "/Users/Kaibob/Photos". Also, the search is not case sensitive but can be made so by changing -iname to -name.

    find ~ \( -iname '*David*' -o -iname '*dberch*' -o -iname '*berchtold*' \) \( -iname '*.jpg' -o -iname '*.png' \)
  6. chown33 macrumors 604

    Aug 9, 2009
    Sorry, I neglected to say that I was on Mtn Lion, rather than Mavericks.

    I don't have Mavericks on anything here, so I can't describe what it does on Mavericks. Maybe someone else can provide the details you seek.
  7. dyt1983, Mar 13, 2015
    Last edited: Jun 2, 2015

    dyt1983 macrumors 65816

    May 6, 2014
    edit: To remove personally identifying information not relevant to the thread.
  8. BrianBaughn macrumors 603


    Feb 13, 2011
    Baltimore, Maryland

Share This Page