Searching for specific text within files on your Mac is easy with these methods:
Method 1: Using Spotlight Search (Quick Search)
- Open Spotlight by:
- Clicking the magnifying glass icon in your menu bar
- OR pressing
Command (⌘) + Spacebar
- Type your search term in the search field
- Scroll down to the “TOP HIT” section and look for “Search in Finder” at the bottom
- 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)
- Open a new Finder window (
Command (⌘) + N
) - Press
Command (⌘) + F
to open the search field - Click the “+” button to add search criteria
- From the first dropdown menu, select:
- “Contents” to search inside files
- OR “File Name” to only search filenames
- Enter your search term in the text field
- (Optional) Narrow results by:
- Selecting specific folders to search
- Adding more filters (date modified, file type, etc.)
Method 3: Using Terminal (For Power Users)
- Open Terminal (Finder → Applications → Utilities)
- 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
orkind:docx
- To rebuild Spotlight’s index if searches aren’t working:
- Go to Apple Menu → System Settings
- Select Siri & Spotlight
- Click Spotlight Privacy
- Drag your hard drive icon into the list
- 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