Spotlight! Apple Search Technology SH!

Spotlight is the name of app for local (desktop) search for macOS.

Introduction for Beginners

Medium- and Advanced- level users

Advanced – Backend, Frontend

Components Spotlight, by Apple Other
Backend (database, tools)
  • Database with indexed contents
  • Tools for creating / maintaining index db, et c
(See Search! macOS-Focus – /is/apps/macos/search/)

 

Frontend (search, present)
  • Spotlight application (command+Space)
  • msl
(See Search! macOS-Focus – /is/apps/macos/search/)

 

A quite great depiction of functionality and tools:

From eclecticlight.co/2023/07/19/searching-icloud-drive-with-spotlight/

 

Alternatives to Spotlight

See Search! macOS-Focus – /is/apps/macos/search/

 

Configuration, Configuring Spotlight Functionality

Order of Results – NO…

In modern versions of macOS (starting with El Capitan and continuing through Sonoma and Sequoia), Apple removed the ability to manually reorder Spotlight search result categories via System Settings. Previously, users could drag and drop items like “Applications” or “PDFs” to prioritize them, but this feature is no longer available in the native interface.

To control the order of results in current macOS versions, you must use one of the following workarounds:

  • Use Spotlight Keywords: Type specific keywords to filter results by type. For example, typing kind:app [search term] forces the results to be sorted by applications, placing them at the top.

  • Disable Unwanted Categories: Go to System Settings > Siri & Spotlight (or System Preferences > Spotlight on older macOS) and uncheck categories you never use (such as “Web” or “Contacts”). This prevents them from appearing in your results, effectively pushing your preferred categories higher.

  • Modify the Plist File (Advanced): You can manually edit the com.apple.Spotlight.plist file located in ~/Library/Preferences/ using Terminal or a text editor to reorder the OrderedItems array. This involves exporting the plist, editing the XML to change the order of category keys (e.g., moving com.apple.appstore higher), and importing it back, followed by restarting the Spotlight service (killall Spotlight). This method is unstable and not officially supported.

  • Third-Party Launchers: Applications like Alfred or Raycast allow full customization of search result ordering and provide a more robust alternative to the native Spotlight interface.

If you are on an older version of macOS (Mavericks or earlier), you can still reorder results by going to System Preferences > Spotlight and dragging the categories in the Search Results tab. 

com.apple.Spotlight.plist file located in ~/Library/Preferences/ using Terminal or a text editor to reorder the OrderedItems array.

o reorder the Spotlight search results in macOS, you must modify the OrderedItems array within the com.apple.Spotlight.plist file using Terminal commands, as the graphical interface no longer allows reordering in recent versions.

You can directly write the desired order using the defaults command. The items listed first take the highest priority. Use the following structure in Terminal:

defaults write com.apple.Spotlight orderedItems -array \
    '{ "enabled" = 1; "name" = "APPLICATIONS"; }' \
    '{ "enabled" = 1; "name" = "SYSTEM_PREFS"; }' \
    '{ "enabled" = 1; "name" = "DIRECTORIES"; }' \
    '{ "enabled" = 1; "name" = "PDF"; }' \
    '{ "enabled" = 1; "name" = "FONTS"; }' \
    '{ "enabled" = 0; "name" = "DOCUMENTS"; }' \
    '{ "enabled" = 0; "name" = "MESSAGES"; }' \
    '{ "enabled" = 0; "name" = "CONTACT"; }' \
    '{ "enabled" = 0; "name" = "EVENT_TODO"; }' \
    '{ "enabled" = 0; "name" = "IMAGES"; }' \
    '{ "enabled" = 0; "name" = "BOOKMARKS"; }' \
    '{ "enabled" = 0; "name" = "MUSIC"; }' \
    '{ "enabled" = 0; "name" = "MOVIES"; }' \
    '{ "enabled" = 0; "name" = "PRESENTATIONS"; }' \
    '{ "enabled" = 0; "name" = "SPREADSHEETS"; }' \
    '{ "enabled" = 0; "name" = "SOURCE"; }' \
    '{ "enabled" = 0; "name" = "MENU_DEFINITION"; }' \
    '{ "enabled" = 0; "name" = "MENU_OTHER"; }' \
    '{ "enabled" = 0; "name" = "MENU_CONVERSION"; }' \
    '{ "enabled" = 0; "name" = "MENU_EXPRESSION"; }' \
    '{ "enabled" = 0; "name" = "MENU_WEBSEARCH"; }' \
    '{ "enabled" = 0; "name" = "MENU_SPOTLIGHT_SUGGESTIONS"; }'

Key Notes:

  • Enabled vs. Disabled: Set "enabled" = 1 for categories you want to see, and "enabled" = 0 to hide them.

  • Reapplication: After running the command, you may need to quit and restart Spotlight (via Activity Monitor or killall Spotlight) or toggle a setting in System Preferences to apply changes immediately.

  • Resetting: If the plist becomes corrupted, deleting ~/Library/Preferences/com.apple.Spotlight.plist and restarting Spotlight will reset it to defaults.

Method 2: Text Editor

  1. Open Terminal and convert the plist to XML:

    plutil -convert xml1 ~/Library/Preferences/com.apple.Spotlight.plist
  2. Open the file in a text editor:

    open -e ~/Library/Preferences/com.apple.Spotlight.plist
  3. Locate the <key>OrderedItems</key> section.

  4. Reorder the <dict> blocks containing name and enabled keys to your preferred sequence.

  5. Save the file and restart Spotlight.

Common Category Names

  • APPLICATIONS

  • SYSTEM_PREFS

  • DIRECTORIES

  • DOCUMENTS

  • IMAGES

  • MUSIC

  • MOVIES

  • SOURCE (Developer/Xcode results)

  • MENU_WEBSEARCH (Safari/Search suggestions)

 

forums.macrumors.com/threads/spotlight-showing-developer.1972627/

 

History

macOS 27, Sep 2026

General

search.brave.com/search?q=macos27+spotlight

In macOS 27 Golden Gate, Spotlight has been fundamentally redesigned to integrate Siri AI, transforming it from a simple file finder into a conversational search interface. The search bar now displays “Search or Ask”, allowing users to either perform traditional semantic searches for files and apps or engage in natural language conversations with Siri, which can draw on personal context from Mail, Messages, and Photos.

Key changes and user feedback include:

  • Unified Interface: Spotlight and Siri share the same input field, enabling users to ask open-ended questions or request actions (like creating calendar events) directly within the search window.

  • Performance Improvements: Apple has rebuilt the underlying search infrastructure to make indexing faster and more stable, addressing reliability issues that plagued the previous macOS 26 Tahoe version.

  • Menu Bar Removal: The dedicated Spotlight magnifying glass icon has been removed from the menu bar; users must rely on the Command + Space keyboard shortcut or the Siri AI button in the menu bar.

  • Categorized Shortcuts: Users can quickly filter results using keyboard shortcuts: Command + 1 (Apps), Command + 2 (Files), Command + 3 (Actions/Shortcuts), and Command + 4 (Clipboard).

  • Community Reception: Early adopters report mixed reactions; while many praise the speed and AI integration, others criticize the new Siri-like design as cluttered and note that non-Apple services (like Gmail) may not surface results as effectively as native apps. 

 

Sluggish Behavior, Spotlight on macOS 27 (27.0)

macOS Spotlight has delay when search on things compared to Alfred 5 that shows results immedaitely… Is this really normal behavior?
search.brave.com/search?q=macOS+Spotlight+has+delay+when+search+on+things+compared+to+Alfred+5+that+shows+results+immedaitely…+Is+this+really+normal+behavior%3F

 

No, it is not normal for macOS Spotlight to have significant delays, especially if third-party tools like Alfred 5 return results immediately. Users report that Spotlight has become progressively slower in recent macOS versions (such as Tahoe and Sequoia), often taking several seconds to display results for apps or files, whereas Alfred frequently leverages the same underlying metadata but limits result types to parse faster.

Common causes for this lag include:

  • External Drives: Spotlight often stalls while waiting for connected external hard drives (like Time Machine backups) to spin up or mount.

  • Index Corruption: The metadata database may be corrupted or incomplete, requiring a rebuild.

  • Bloat: Excessive search categories or “related content” can slow down the UI rendering.

To resolve this, you can try the following steps:

  1. Exclude External Drives: Add any frequently connected external drives to the Spotlight Privacy list in System Settings to prevent Spotlight from waiting on them.

  2. Rebuild the Index: Go to Spotlight Privacy, add your main drive, wait a moment, then remove it to force a re-index.

  3. Simplify Settings: Disable unnecessary search categories (like websites, contacts, or system settings) in Spotlight Settings to reduce processing load.

  4. Kill the Process: If the lag is temporary, using Activity Monitor to quit the Spotlight process can force it to respawn with improved performance. 

 

Problems Research

Discrepancies Finding Stuff – Front-End / Graphical User Interface apps

Primary focus here is issues with using different Graphical User Interface (GUI) – tools.)

Updated 2026-09-29 with info related to macos 27.

Front-end
(User interface)
(Keyboard*) (Backend)
(~Database)
General experience Sep’26
macOS 26, Tahoe, 26.6.2 (25G83)
General experience Sep’26 macOS 27 Golden Gate, 27.0.
1. Spotlight Command-Space (Spotlight) ❗️Altogether taking it’s time to find and show results, starting with ‘less applicable’ (not a file/folder really looking for)
Same for finding a .dmg.
❗️Like macOS 26… Shoot – had big hopes for improvements in Spotlight, especially front-end/user interface side……
2. Alfred 5 Alt-Space* (Spotlight) ✅  ‘Immediately’ shows the file/folder looking for.
❗️NOT finding .DMG files BUT that was due to missed checking Archives (in Default Results settings tab. ✅)
✅ End of continue to use Alfred 5 as primary front-end.
3, HoudahSpot (Spotlight) ✅ Quickly finds file/folder looking for, including DMGs.
4+ Tembo, … Not tested here and now (Spotlight) Not tested here and now
(mdfind, mdls Not tested here and now (Spotlight) (Command Line Interface (‘CLI’) tools, NOT GUI tools.)

 

More Details – Deeper

  1. Restart Spotlight-Related Services
    1. SystemUIServer
    2. Spotlight
    3. mds
  2. Restart Your Mac
  3. Check Your Keyboard Shortcuts
  4. Check Your Spotlight Settings
  5. Update Your Mac
  6. Check for Disk Errors
  7. Reindex Spotlight Search
  8. Disable and Reactivate Spotlight Index
  9. Clear the Mac’s Cache

 

 

The Problems: Spotlight won’t work

There are several incarnations of Spotlight problems that I have personally run into, they are:

  • Problem #1) Spotlight menu icon highlights, but no search form appears
  • Problem #2) Spotlight search form appears, but no results are shown
  • Problem #3) Spotlight search works, but results are poor and incomplete

While not entirely sure what causes any of these problems, try these troubleshooting methods that frequently work to repair Spotlight:

The Solutions: Troubleshooting Spotlight

Solution #1: Kill SystemUIServer

  • Launch ‘Activity Monitor’ (located in /Applications/Utilities/)
  • Locate the process ‘SystemUIServer’, highlight it, and click the red button “Quit Process”
  • Within a few seconds the menubar will rebuild itself and often Spotlight will magically work

Solution #2: Rebuild the Spotlight Index manually

  • Launch ‘Terminal’ (located in /Applications/Utilities/)
  • At the command prompt, type this exactly:sudo mdutil -E /
  • You will be asked for your password, provide it, as this command requires administrator privelages to run
  • You will receive a confirmation message saying that index will be rebuilt
  • Wait until index is finished rebuilding, this can take a while depending on the size of your hard drive, amount of files, etc.
  • Note: You can also rebuild the Spotlight index with MainMenu, mentioned in Solution #4

Solution #3: Change Desktop Resolution

  • This is a strange fix but it works everytime for me when my Spotlight menu icon highlights but the search form doesn’t appear
  • Open “System Preferences” via the Apple Menu
  • Click ‘Displays’ and select a resolution smaller than what you are currently using, 640×480 seems to always work
  • Select your native resolution again, changing your screen resolution back to normal
  • The Spotlight search tray will magically become available again

Solution #4: Clear caches and preferences

  • Clear caches and preferences relating to Spotlight, this is best done through either the free tool OnyX, or the free tool MainMenu, we recommend MainMenu because it’s easier for novices
  • Install MainMenu
    • a little Hammer and Wrench icon will appear in your menubar
    • navigate down to ‘Cleaning’ and clean out User Cache, System Cache, and Font Caches
  • Note: Some users discover that just cleaning the Font caches is adequate to repair a screwy Spotlight, but it won’t hurt to clear them all

Solution #5: Reboot your Mac

  • This should almost be listed as #1 just because sometimes a simple reboot will fix Spotlight, but if I can avoid a reboot I will, and often, a reboot isn’t good enough

What do MDS and MDWorker have to do with Spotlight?
The MDS process and mdworker processes usually run concurrently on your Mac when Spotlight is indexing your Mac. Let the processes finish running to complete a relevant search index of your Mac filesystem.

Hopefully that covers it, and Spotlight should be working good as new again. If we missed something, feel free to contribute in the comments below.

Happy Spotlighting!

 

Not Finding Items At All

(2026-08-22. After a quite major operations involving creating a brand-new user and copying lots of materials from an older user, realize having problems finding essentially ANYTHING using Spotlight. Apps and other misc – YES; (own) files and folders – NO.

Q: mdls shows some result but mdfind does not, what’s wrong and how to fix?

A:

The discrepancy occurs because mdfind relies on the Spotlight database, which may be incomplete, corrupted, or excluding specific files/folders, while mdls queries the file directly using the Spotlight API without relying on the global search index. 

To resolve this, you can:

  • Rebuild the Spotlight Index: Use sudo mdutil -E / to erase and rebuild the index for the main volume, which often resolves missing results. 

  • Check Indexing Exclusions: Ensure the file or folder is not in the Privacy list in System Settings > Siri & Spotlight > Spotlight Privacy, which prevents Spotlight from indexing it. 

  • Use mdls for Direct Inspection: If mdfind fails, use mdls <filename> to verify that the metadata attributes (like kMDItemContentType or kMDItemFSName) are present and correctly populated. 

  • Verify File Type Support: Some file types (like .wsdl) may lack a Spotlight importer, meaning they are not indexed for content search; check if the file type is supported by using mdls -name kMDItemContentType <file>. 

  • Use mdfind -onlyin for Specific Directories: If global search is broken or slow, use mdfind -onlyin /path/to/dir "query" to force a local scan that may bypass index issues. 

  • Check for Index Corruption: If rebuilding fails, ensure the disk is not read-only and has sufficient space, as index corruption can stem from filesystem errors.

 

Try mdls

Checking ‘(like kMDItemContentType or kMDItemFSName) are present and correctly populated’ and it turns out the second actually has ‘(null’) – not good.

joe@MB2314 ~ % mdls ~/Documents/Researchƒ
_kMDItemDisplayNameWithExtensions      = "Researchƒ"
kMDItemContentCreationDate             = 2026-08-21 12:38:08 +0000
kMDItemContentCreationDate_Ranking     = 2026-08-21 00:00:00 +0000
kMDItemContentModificationDate         = 2026-08-23 11:49:09 +0000
kMDItemContentModificationDate_Ranking = 2026-08-23 00:00:00 +0000
kMDItemContentType                     = "public.folder"
kMDItemContentTypeTree                 = (
"public.folder",
"public.directory",
"public.item"
)
kMDItemDateAdded                       = 2026-08-22 12:18:08 +0000
kMDItemDateAdded_Ranking               = 2026-08-22 00:00:00 +0000
kMDItemDisplayName                     = "Researchƒ"
kMDItemDocumentIdentifier              = 0
kMDItemFSContentChangeDate             = 1970-01-01 00:00:00 +0000
kMDItemFSCreationDate                  = 1970-01-01 00:00:00 +0000
kMDItemFSCreatorCode                   = ""
kMDItemFSFinderFlags                   = 0
kMDItemFSHasCustomIcon                 = 0
kMDItemFSInvisible                     = 0
kMDItemFSIsExtensionHidden             = 0
kMDItemFSIsStationery                  = 0
kMDItemFSLabel                         = 0
kMDItemFSName                          = (null)
kMDItemFSNodeCount                     = 0
kMDItemFSOwnerGroupID                  = 0
kMDItemFSOwnerUserID                   = 0
kMDItemFSSize                          = 0
kMDItemFSTypeCode                      = ""
kMDItemInterestingDate_Ranking         = 2026-08-23 00:00:00 +0000
kMDItemKind                            = "Folder"

Which thus makes sense why mdfind fails finding:

joe@MB2314 ~ % mdfind kind:folder -name 'Researchƒ'
2026-08-23 06:50:13.240 mdfind[98687:4189825] [UserQueryParser] Loading keywords and predicates for locale "en_US"
2026-08-23 06:50:13.240 mdfind[98687:4189825] [UserQueryParser] Loading keywords and predicates for locale "en"

joe@MB2314 ~ % mdfind  -name 'Researchƒ'
2026-08-23 06:51:29.717 mdfind[98739:4191192] [UserQueryParser] Loading keywords and predicates for locale "en_US"
2026-08-23 06:51:29.717 mdfind[98739:4191192] [UserQueryParser] Loading keywords and predicates for locale "en"

Run mdutil to rebuild index

Ok, start rebuilding, will take time…

joe@MB2314 ~ % date; sudo mdutil -E /
Sun Aug 23 06:52:34 CDT 2026
/:
Indexing enabled.
joe@MB2314 ~ % mdfind  -name 'Researchƒ'
2026-08-23 06:53:40.400 mdfind[98830:4193693] [UserQueryParser] Loading keywords and predicates for locale "en_US"
2026-08-23 06:53:40.401 mdfind[98830:4193693] [UserQueryParser] Loading keywords and predicates for locale "en"

joe@MB2314 ~ % mdls ~/Documents/Researchƒ
_kMDItemDisplayNameWithExtensions      = "Researchƒ"
kMDItemContentCreationDate             = 2026-08-21 12:38:08 +0000
kMDItemContentCreationDate_Ranking     = 2026-08-21 00:00:00 +0000
kMDItemContentModificationDate         = 2026-08-23 11:49:09 +0000
kMDItemContentModificationDate_Ranking = 2026-08-23 00:00:00 +0000
kMDItemContentType                     = "public.folder"
kMDItemContentTypeTree                 = (
"public.folder",
"public.directory",
"public.item"
)
kMDItemDateAdded                       = 2026-08-22 12:18:08 +0000
kMDItemDateAdded_Ranking               = 2026-08-22 00:00:00 +0000
kMDItemDisplayName                     = "Researchƒ"
kMDItemDocumentIdentifier              = 0
kMDItemFSContentChangeDate             = 1970-01-01 00:00:00 +0000
kMDItemFSCreationDate                  = 1970-01-01 00:00:00 +0000
kMDItemFSCreatorCode                   = ""
kMDItemFSFinderFlags                   = 0
kMDItemFSHasCustomIcon                 = 0
kMDItemFSInvisible                     = 0
kMDItemFSIsExtensionHidden             = 0
kMDItemFSIsStationery                  = 0
kMDItemFSLabel                         = 0
kMDItemFSName                          = (null)
kMDItemFSNodeCount                     = 0
kMDItemFSOwnerGroupID                  = 0
kMDItemFSOwnerUserID                   = 0
kMDItemFSSize                          = 0
kMDItemFSTypeCode                      = ""
kMDItemInterestingDate_Ranking         = 2026-08-23 00:00:00 +0000
kMDItemKind                            = "Folder"

joe@MB2314 ~ %

RESTARTED Whole Computer – FIXED IT

And THAT seems to have helped alright! Now kMDItemFSName is properly populated.

[Restored Aug 23, 2026 at 07:01:34]
Last login: Sun Aug 23 07:01:34 on ttys010
You have mail.
joe@MB2314 ~ %  mdls ~/Documents/Researchƒ
_kMDItemDisplayNameWithExtensions      = "Researchƒ"
kMDItemContentCreationDate             = 2026-08-21 12:38:08 +0000
kMDItemContentCreationDate_Ranking     = 2026-08-21 00:00:00 +0000
kMDItemContentModificationDate         = 2026-08-23 11:49:09 +0000
kMDItemContentModificationDate_Ranking = 2026-08-23 00:00:00 +0000
kMDItemContentType                     = "public.folder"
kMDItemContentTypeTree                 = (
"public.folder",
"public.directory",
"public.item"
)
kMDItemDateAdded                       = 2026-08-22 12:18:08 +0000
kMDItemDateAdded_Ranking               = 2026-08-22 00:00:00 +0000
kMDItemDisplayName                     = "Researchƒ"
kMDItemDocumentIdentifier              = 0
kMDItemFSContentChangeDate             = 2026-08-23 11:49:09 +0000
kMDItemFSCreationDate                  = 2026-08-21 12:38:08 +0000
kMDItemFSCreatorCode                   = ""
kMDItemFSFinderFlags                   = 1024
kMDItemFSHasCustomIcon                 = (null)
kMDItemFSInvisible                     = 0
kMDItemFSIsExtensionHidden             = 0
kMDItemFSIsStationery                  = (null)
kMDItemFSLabel                         = 0
kMDItemFSName                          = "Researchƒ"
kMDItemFSNodeCount                     = 40
kMDItemFSOwnerGroupID                  = 20
kMDItemFSOwnerUserID                   = 507
kMDItemFSSize                          = (null)
kMDItemFSTypeCode                      = ""
kMDItemInterestingDate_Ranking         = 2026-08-23 00:00:00 +0000
kMDItemKind                            = "Folder"
joe@MB2314 ~ %

joe@MB2314 ~ % mdfind -name 'Researchƒ' 
2026-08-23 10:51:30.018 mdfind[14387:331897] [UserQueryParser] Loading keywords and predicates for locale "en_US"
2026-08-23 10:51:30.018 mdfind[14387:331897] [UserQueryParser] Loading keywords and predicates for locale "en"
/Users/joe/Documents/Researchƒ
/Users/joe/Documents/Researchƒ/IT! RD/Apps! Applications! macOS/Dropbox!/Problems,Troubles,Troubleshooting/ \
  2024 and earlier/2018/2018-05-04.. May-Jun-Jul, major resyncs, from ƒ to # to !/ \
  2018-05-12 07.54.10 Changed Researchƒ to Research! (!!! major change, inclde affecting Shared to CV).png
/Users/joe/Documents/Researchƒ/IT! RD/Apps! Applications! macOS/Dropbox!/Problems,Troubles,Troubleshooting/ \
  2024 and earlier/2018/2018-05-04.. May-Jun-Jul, major resyncs, from ƒ to # to !/ \
  2018-05-15 17.27.30 Finder- Researchƒ.png
...

Note: mdfind Syntax: kind:folder seems to have to be AFTER (e.g.) -name

Maybe this version of macOS (Tahoe, 26.6.2)…

joe@MB2314 ~ % mdfind kind:folder -name 'Researchƒ'
2026-08-23 10:51:48.367 mdfind[14405:332285] [UserQueryParser] Loading keywords and predicates for locale "en_US"
2026-08-23 10:51:48.367 mdfind[14405:332285] [UserQueryParser] Loading keywords and predicates for locale "en"
joe@MB2314 ~ %

No find.

joe@MB2314 ~ % mdfind -name "Researchƒ" kind:folder
2026-08-23 10:56:19.689 mdfind[14681:337965] [UserQueryParser] Loading keywords and predicates for locale "en_US"
2026-08-23 10:56:19.690 mdfind[14681:337965] [UserQueryParser] Loading keywords and predicates for locale "en"
/Users/joe/Documents/Researchƒ

(Did find.)

joe@MB2314 ~ % mdfind kind:folder -name 'Researchƒ'
2026-08-23 10:56:29.323 mdfind[14691:338097] [UserQueryParser] Loading keywords and predicates for locale "en_US"
2026-08-23 10:56:29.324 mdfind[14691:338097] [UserQueryParser] Loading keywords and predicates for locale "en"

joe@MB2314 ~ % mdfind kind:folder -name "Researchƒ"
2026-08-23 10:56:35.215 mdfind[14696:338225] [UserQueryParser] Loading keywords and predicates for locale "en_US"
2026-08-23 10:56:35.216 mdfind[14696:338225] [UserQueryParser] Loading keywords and predicates for locale "en"

joe@MB2314 ~ %

eop

Command Line, man pages, …

mds Command

MDS(8)                      System Manager's Manual                     MDS(8)

NAME
     mds – metadata server

SYNOPSIS
     mds

DESCRIPTION
     mds is the metadata server.  It serves all clients of the metadata APIs,
     including Spotlight.

     There are no configurations to mds, and users should not run mds
     manually.

SEE ALSO
     mdfind(1), mdls(1), mdutil(1)

Mac OS X                       January 19, 2006                       Mac OS 

 

mdfind Command

Extract from man page:

mdfind(1)                   General Commands Manual                  mdfind(1)

NAME
     mdfind – finds files matching a given query

SYNOPSIS
     mdfind [-live] [-count] [-onlyin directory] [-name fileName] query

DESCRIPTION
     The mdfind command consults the central metadata store and returns a list
     of files that match the given metadata query. The query can be a string
     or a query expression.

     The following options are available:
...
  • google.com/search?q=using+mdfind
  • mdfind 'search!' Command
    • macos:~ joe mdfind kind:folder -name 'search!'
      2023-05-16 18:06:12.227 mdfind[55946:6186246] [UserQueryParser] Loading keywords and predicates for locale "en_US"
      2023-05-16 18:06:12.227 mdfind[55946:6186246] [UserQueryParser] Loading keywords and predicates for locale "en"
      /Users/joe/Library/CloudStorage/Dropbox/Research!/IT/Apps! Applications! macOS/Desktop search!
      /Users/joe/Library/CloudStorage/Dropbox/Research!/IT/Search!! Finding stuff
      /Users/joe/Library/CloudStorage/Dropbox/Research!/IT/Search!! Finding stuff/Search! different types of search implementations terms autocomplete contextual
      macos:~ joe$ 
  • …

mdls Command

Extract from man page:

MDLS(1)                     General Commands Manual                    MDLS(1)

NAME
     mdls – lists the metadata attributes for the specified file

SYNOPSIS
     mdls [-name attributeName] [-raw [-nullMarker markerString]] file ...

DESCRIPTION
     The mdls command prints the values of all the metadata attributes
     associated with the files provided as an argument.

     The following options are available:
...

 

mdutil Command

Extract from man page:

mdutil(1)                   General Commands Manual                  mdutil(1)

NAME
     mdutil – manage the metadata stores used by Spotlight

SYNOPSIS
     mdutil [-pEsav] [-i on | off] mountPoint ...

DESCRIPTION
     The mdutil command is useful for managing the metadata stores for mounted
     volumes.

     The following options are available:
...

 

mdimport Command

Extract from man page:

mdimport(1)                 General Commands Manual                  mdimport(1)

NAME
     mdimport – import file hierarchies into the metadata datastore.

SYNOPSIS
     mdimport [-itpAXLr] [-d level] [-o -outputfile] [ file | directory ... ]

DESCRIPTION
     mdimport is used to test Spotlight plug-ins, list the installed plug-ins and
     schema, and re-index files handled by a plug-in when a new plug-in is installed.

     The following options are available:
...