The search feature in macOS is very deep, including the ability to search metadata in media files, dimensions of images, fonts used, file origins, and much more.
You can also watch this video at YouTube.
Watch more videos about related subjects: Finder (317 videos).
You can also watch this video at YouTube.
Watch more videos about related subjects: Finder (317 videos).
Video Transcript
Hi, this is Gary with MacMost.com. Today let's look at 10 useful advanced file search techniques.
MacMost is brought to you thanks to a great group of more than 1000 supporters. Go to MacMost.com/patreon. There you can read more about the Patreon Campaign. Join us and get exclusive content and course discounts.
So when you do a file search in Finder by default it will search for the name or content of the file. But you can get much more advanced than that. Let's start off here with a simple search for a name. Now you can use the search field here at the top right or you can use Command F which is the shortcut for File, Find, to open up a new window or tab and start a search. Now if I search for something up here, like Test, then I'm going to come up with files that match either the name or the content. Notice some of these files don't have that in the name. It's because this word is in the content of the file. It said if I go down here to File Names contains test you'll see it changes here to say name and I'm searching just for the name. So all of the results here have that in the name. I can click here and then change that to everything to search for name and the content. A shortcut for that is simply to type name colon and then whatever you want. This will search just for the name and I don't even have to select this. Once I do you can see it just converts it to that.
Now alternatively I can not type anything up here at all and I can go right to the Search Criteria here. Notice the very first thing is the Search Scope. So you can set it to the entire Mac or just the location you started in. If you want to customize that go to Finder, Preferences and then under When Performing a Search you can set it to Default to Search This Mac, Search the Current Folder, or Return to the Previous Folder you were searching in the last search that you did. Now it's going to give you the default criteria Kind is Any. You'd think then that it would then give you results that would include every file at this location. But by convention here it just is going to not show you anything. It's going to assume Kind is Any then relates to whatever you're searching up here. But if you were to change this to something else it would then give you the results. So, for instance, if I did Kind is Image I'd get the images there.
Now let's focus on searching by name. If I select Name here then I could, just as before, do a search. But I have more advanced features here. I could do name matches or name contains. Notice that Name Contains is a different search. This one, for instance here, finds tes.t and matches to that. So there is some slight differences between these two. You could also do Begins With or Ends With like that. You could also do Is for an exact match. So only files that are exactly this. If you wanted to you could do Is Not. So now I get results of every file that is not with that.
Now you can change from Name to all sorts of other things. So one thing you can select is Kind and then you could then set it to anything other than Any and it will give a result. So, for instance, All of the Images. But notice that this goes an extra level deep in some cases. For instance, Kind is Image allows you then to select the type of image. So I could say I just want jpeg's. Or I just want png's. Notice here when I had All selected it had psd's (photoshop documents) as an option. But I didn't see psd right there. I can go to Kind Is Other and then I could type something in here. So if I want to look for Photoshop Documents I could type Photoshop. Now what is that matching exactly? Well, if I select a file here and I do Command i, I can see here Kind and it's looking right here for the match. So, for instance, if I were to search for document here you would wonder, well what qualifies something as a document. Well, it's simple. If you selected and get Info you could see in this case Kind is Pages Documents. So it's taking that word from the Kind there and matching it. But if I did psd here you could see it comes up with nothing because that doesn't match Kind. I could instead do Name and then Ends With to match those.
Now what if you do want to match the contents and not the name. So you know some words are used somewhere in the document. Instead of name you can go to Contents and this will ignore the name and simply look for things that have this word somewhere in the contents of the document. Usually these will be text documents. Things with the word actually written in there. But sometimes they can be found in types of documents if the app that created it actually stores words, like maybe text over an image, in such a way that it can be found by Spotlight.
Now a lot of other things you're going to find if you choose Other here. It's going to come up with a whole list of things that you can search for. However most of these just apply to one particular application or another. For instance a lot of these have to do with music files. There are things like about the composer. Other things have to do with photos taken by a camera so that you've got things like aperture and exposure and all of that. So, for instance, let's go into the Documents folder here and then let's go into Projects and select a file like this one here. I can use Command i and I could see Tags right up here and I can add a tag. So let's set a tag called Work to this. Now if I return to a search I can search for that tag. Let me do Other and then I'm going to search here for Tags and then do Work and it will show up. Now sometimes it can get confusing because instead of Tags, if I maybe discovered key words, I would think maybe this is Tags in the Finder. You could see it comes up with nothing. So it will actually search the entire Mac and you could see it comes up with a bunch of things here. What's all this about? Well, here's some stock photography, for instance. If I do Command i with it I can see here under More Info work is actually a key word in there. That's part of the files, part of the metadata describing what's in this file. It's not the tag that I add up here myself. So this would be something created in the graphics app that made this image.
You run into the same thing here if you go and look for Comments. So you've got comments about this item. So if I look for Comment matches that and I look here I could see there is indeed key words, where, from and a whole bunch of metadata and that's somewhere there in that metadata. On the other hand if I were to go to a file like before and add something here to the Comments then I would search and find that not using Comment but instead using Spotlight Comment. So you could see Spotlight Comment matches work comes up with that file.
Another useful one that you could do is Font. So you could look for Fonts used in this item. Let's do that. So Font Matches let's say I'm looking for Arial. I could see here some documents that have that font. There's a lot of them including the Font itself. So I may want to add another criteria here that says Kind Is and then Documents. Now I can see all the documents that use this. It could be useful if you find some sort third party font on your Mac and you want to decide whether or not you should get rid of it. You could see which documents are currently using that font. Just make sure you're searching either This Mac or some area that's going to have all the documents that you want that font.
Another useful one is Pages. So, Pages search for the number of pages in a document. So normally you want to do Is Greater Than, let's say how many documents do I have that are more than 100 pages. So here's a whole bunch of them. More than 500 pages. So there's a bunch here. So it's an alternate way to look for something by size. I could say give me all the pdf's or all the Pages documents or something where the length of the document is greater than 500 pages. One really interesting thing that you could do is you could search for Applications. So I could do Kind is Application and On This Mac is going to give me all of the Apps installed. Now I could make it a little easier for Spotlight if I actually go into the Applications folder first and then doing Command F. So now it's going to search just Applications here and then I could say Kind Is Application. Now the cool thing is you could do more than that because you can add another criteria and search for App. I come up with Category, App Store Category. So let's go into that and I can say Category Matches and say Games, Productivity or let's say Graphics. This could be one of those things that's really good if you Save it and create a Saved Search For it. Let's call it Graphic's Apps. Then have it add to the Sidebar. So now I can easily find all my graphic's apps anytime I want. I can actually drag that to the right side of the Dock and now I have all my graphic's apps here.
Now like that pages one I showed you before there's a way to search for folders that have a certain number of items in them. So we could do Kind is Folder but only folders are going to show up in this result anyway. So now we can do Folder and say number of items. There it is. You could say the Number of Items is greater than, and I could say 1000. So here are the folders on my Mac that have more than a 1000 items in them. You could also search for images that have a certain width or height or total pixel count. So let's go to Other here and search for pixels and we can see Pixel Count, Height, or Width. So, for instance we do Count we can say Pixel Count is Greater Than and some really big number like one million. It's going to give me all the images that have that many pixels in it. A hundred million. So these are the largest images I've got by the number of pixels, not by the actual size. So compression may be making some of these smaller than my largest images but still they are the ones that take up the most screen space. But I could also do pixel width or pixel height. So let's do pixel height. 4K is equivalent to 2160 vertically. So if I do that notice I'm getting a lot of videos here because I didn't say I just wanted images. So it is giving me any file that's got 2160 pixels in height. Videos and images. So I could specify the Kind Is an image like those or I could say it's a video. So this is a quick way to find all of your 4K video or anything that's 4K or greater.
You could also choose Where. So what does where do? Well, where the item came from. If you downloaded files you can find the file that came from a certain site. So I can use Adobe to find all of the ones that I downloaded from the Adobe Stock Photography site that I use. You can see all of these here. If I select a file and do Command i you'll even see here, under More Info, it says where from and it is giving me the full URL to it. That URL, of course, includes Adobe which is why it matches this.
I want to throw in a few more tips here. Notice this list the top stays the same and this one shows me things I recently used. But if there is one that you find useful, like for instance Pixel Count, you can check the box here and now that one will stay here at the top part. Also if you want to search by name for Wild Cards you can do it. Of course in most cases you can just choose Matches and then type something like that and get the results that you want. Let's say you want to do something where you could get everything that starts with the letter T and ends with ST. Putting an asterisk there won't work no matter which one you choose it's still not going to work. But you can use Raw Query to do this. Then you have to set this up with the special kMDitemDisplayName just like that. Capitalization counts and then two equal signs and in quotes put what you're looking for. So this is going to find everything you're looking for exactly. But I can do a Wild Card like that and now it will find things like themeGraphics.cst that begins with a t and ends with st. So it's matching it correctly. If you include the letter c after the quote like that then it won't care about case. So it will match things with a capital T like these here at the bottom.
Now there's a lot more to explore under Other especially if you're using media files, images, sounds, videos, things like that. There are a lot of different ways that you can search for those items. Of course there's a lot of standard stuff to be found in here. For instance you could do a search By Modified Date. You could choose the range how it works. Do something like Before a certain day or Within the Last days, weeks, months, years. So if you're interested in more advanced searches just dig into this and spend the time to try all the different features out.
Hope you found this useful. Thanks for watching.
"go to Finder, Preferences and then under When Performing a Search you can set it to Default to Search This Mac," I have this selected yet it seems my searches, at least according to the search scope, only searches in the folder I started in. Also, I have an external hard drive on my MacBook. Will search go through that drive, too?
tom: Not sure why the default isn't sticking for you. Search "This Mac" should search all drives, unless you have for some reason a drive that isn't indexed (like one formatted for Windows or something).
Gary: that's great, I never looked in "Other" to see all the search options. So, I love the fact that there are options to search photos by focal length and other camera parameters, but given that pretty much all my photos are stored in the Photos app, is there a way to search the folder where the images are stored? I'm not even sure I was ever able to see the individual files that Photo stores or where it stores them. Thx
nick: To search in your Photos Library, do that in the Photos app instead. This is for files.
Thanks Gary Brilliantly helpful tutorial containing so much information I never knew, or even dreamt was possible.
Gary - What am I doing wrong on my 2015 iMac, FusionHD, macOS 12.1. When, under Spotlight, I enter the word glycemic, I find 12 documents on my iMac, but when I do a search in the finder and type glycemic into the very topmost search bar I get no hits? When I hit the + sign and in the first space enter Name and in the second Is I get no hits. Change it to Name and Contains glycemic and still no hits. This is crazy. (Addendum - Why won't MacMost accept my @gmx.com address?
Bob: My guess is the search area. When you use the Finder, what does it say under that? "This Mac" or just your current location? Where are you trying to use your email address (exactly) and what error message do you get?
⌘+Shift+find = Finder window w/ Recents highlighted.
As soon as I enter GLYCEMIC, Robert's iMac is highlighted and I get results.
If I click on the + and use Name/Matches GLYCEMIC and search in my Home folder I get nothing.
Yet, my home folder is precisely where all those GLYCEMIC files and folders are located.
It seems, therefore, it is always going to search on Robert's iMac. Is that it? Thanks, Gary
I am inputting email address where is says Name (required) and Email.
Bob: I'd have to see exactly what you are doing here. Pay careful attention to everything. As for the email address, perhaps you included an extra space before or after it by accident?