Apple Event: May 7th at 7 am PT

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Spotlight query expressions

Is there any query expressions to find files greater than a given size, with Spotlight, such as "size:>xxkb" or in French "taille:>xxko"?

MacBook Air 13″, macOS 12.1

Posted on Jan 1, 2022 4:01 AM

Reply
Question marked as Best reply

Posted on Jan 1, 2022 5:13 AM

Spotlight is an indexing facility, not a sorting tool.


If you want to sort the content found in a search of content on your Mac into a hierarchical list use the Find command in Finder: File > Find (or Command & F), run a search and sort by the size column.


You can also narrow this search, in your example by files greater than a given size, by clicking on the + button in the search box, select Other, scroll down the list of options to File Size - or search for File size in the search box - and select File Size. This creates a new option in the Finder search: Equals, Less, Greater or Is Not. Make your choice, enter a numerical value, choose KB, MB or GB (ie. size). This will filter the results to the specifications you have set.

2 replies
Question marked as Best reply

Jan 1, 2022 5:13 AM in response to tr57

Spotlight is an indexing facility, not a sorting tool.


If you want to sort the content found in a search of content on your Mac into a hierarchical list use the Find command in Finder: File > Find (or Command & F), run a search and sort by the size column.


You can also narrow this search, in your example by files greater than a given size, by clicking on the + button in the search box, select Other, scroll down the list of options to File Size - or search for File size in the search box - and select File Size. This creates a new option in the Finder search: Equals, Less, Greater or Is Not. Make your choice, enter a numerical value, choose KB, MB or GB (ie. size). This will filter the results to the specifications you have set.

Jan 1, 2022 7:34 AM in response to tr57

There are two Spotlight reserved words that can be used (I am on a U.S. English Monterey): size, and kMDItemFSSize. You will have to experiment with whether the French word taile is applicable, or you are restricted to either of the preceding terms.


You can use the following symbolisms: >, >=, <, <=, and - (for range). Values are integer so that a file of size 53KB on disk would be represented in bytes as 51329. Those values are available from the Get Info panel's size entry. Thus, the following can be applied, with the keyword kMDItemFSSize interchangeable with size:


kind:pdf size:51329
kind:pdf size:>51329
kind:pdf size:>=51329
kind:pdf size:<51329
kind:pdf size:<=51329
kind:pdf size:51329-347000


and to show all PDFs that were created in 2021 with a page count of 4 and size exceeding 200K:

kind:pdf created:01/01/2021-12/31/2021 pages:4 size:>200000


Apple shares more about using Spotlight reserved words in the Narrow your search results on Mac (English) and Limiter les résultats de recherche sur Mac (French).


Spotlight query expressions

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