How to search "*"/"?" literally in Finder spotlight

I have a bunch of files containing characters like "?"/"*" distributed in a couple of folders. Due to limitation of Microsoft, I have to change these file names in order to sync them with OneDrive. I wanted to do this in batch so I searched for them in Finder spotlight attempting to get a list, but Finder seems to have treated these characters in the way of wildcards, ending up no desired search list. So how can I search wildcard characters literally plz?

MacBook Pro (Retina, 15-inch, Late 2013), macOS High Sierra (10.13.4)

Posted on Jul 2, 2018 7:08 PM

Reply

Similar questions

5 replies

Jul 3, 2018 6:20 AM in response to everwisher

everwisher wrote:


This is not the case you said, bro. I do have a bunch of file with their names containing "*"or"?", but when I typed in the two characters in Finder spotlight, nothing was given in the main area.

Then there is something wrong with your Spotlight index, bro. Spotlight doesn't use wildcards. If you typed both characters, you would have to have a name with both of those in the same order.

The Spotlight search has limited ordering abilities. Use the Finder as I stated earlier.


If you want to search for file names that contain * or ?, then use the finder.

In the Criteria, hold down the Option key and click the … button at the end of the criteria line (it was a + button)

Leave it set for "Any"

Remove the top, kind is any criteria by clicking on the - button (however, you could just leave it).

Below "Any", change the Criteria to Name contains *.

Click the + button next to that line and change it to Name contains ?

User uploaded file

Jul 3, 2018 5:22 AM in response to everwisher

In Spotlight, or a given Finder Window's search pane, you can do the following with the name keyword which can find files/folders with as little as a single character or full name. In the following, the characters are searched for literally, and not to be confused as wildcards:


name:*

name:?

name:/


The top hits will be those filenames containing those characters. If two of these characters are adjacent in the filename, then you can specify both instead of the single character examples above.


The only character that Finder rejects is the ':' character as that is reserved for the Finder HFS file path separators.

Jul 3, 2018 5:34 AM in response to VikingOSX

Weird enough when I typed "name:?" in the upper right input box, nothing gained. But only when I did this could I add more search criteria up in the main area of Finder, where I selected "name"->"contain" (the options can be some other words I can't name because I'm not using English as my system language) and type in "?". And I had to delete "name:?" I typed in the former box to finally make the search result seen.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

How to search "*"/"?" literally in Finder spotlight

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.