How to search in Mac

Searching for specific text within files on your Mac is easy with these methods:

Method 1: Using Spotlight Search (Quick Search)

  1. Open Spotlight by:
    • Clicking the magnifying glass icon in your menu bar
    • OR pressing Command (⌘) + Spacebar
  2. Type your search term in the search field
  3. Scroll down to the “TOP HIT” section and look for “Search in Finder” at the bottom
  4. Click “Search in Finder” to see all files containing your text

Note: Spotlight only searches indexed files (most document types except system files).

Method 2: Using Finder (More Advanced Search)

  1. Open a new Finder window (Command (⌘) + N)
  2. Press Command (⌘) + F to open the search field
  3. Click the “+” button to add search criteria
  4. From the first dropdown menu, select:
    • “Contents” to search inside files
    • OR “File Name” to only search filenames
  5. Enter your search term in the text field
  6. (Optional) Narrow results by:
    • Selecting specific folders to search
    • Adding more filters (date modified, file type, etc.)

Method 3: Using Terminal (For Power Users)

  1. Open Terminal (Finder → Applications → Utilities)
  2. Use this command to search within a folder: grep -r “your search term” /path/to/folder/Example: grep -r “quarterly report” ~/Documents/

Tips for Better Searches:

  • Use quotation marks for exact phrases: "invoice October 2023"
  • Add file type filters in Finder: kind:pdf or kind:docx
  • To rebuild Spotlight’s index if searches aren’t working:
    1. Go to Apple Menu → System Settings
    2. Select Siri & Spotlight
    3. Click Spotlight Privacy
    4. Drag your hard drive icon into the list
    5. Remove it and allow re-indexing

Supported File Types:

Spotlight and Finder can search inside these common formats:

  • Text files (.txt, .rtf)
  • Office documents (.docx, .xlsx, .pptx)
  • PDFs
  • Apple files (.pages, .numbers, .keynote)
  • HTML files
  • Source code files