Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

Delete Files by Type in macOS Sonoma Finder

· 5 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

To delete all files of the same type (e.g., all .png images or all .pdf documents) in macOS Sonoma Finder, you can use a smart folder to gather them, then select and delete them in one go. No extra software is needed—just Finder's built-in search and selection tools. This method works for any file type and avoids manually hunting through folders.

What You'll Need

  • A Mac running macOS Sonoma (or any recent macOS version—the steps are nearly identical).
  • Access to the folder(s) where the files are located (or you can search the entire Mac).
  • Basic familiarity with Finder and the right-click menu.

Step-by-Step

  1. Open Finder by clicking the Finder icon in the Dock (the blue face at the far left).
  2. Navigate to the folder you want to search. If the files are scattered across multiple folders, you can search from your home folder or even the whole Mac—just start at the level that makes sense.
  3. Press Command + F to open a new search window. This works in any Finder window.
  4. Choose the search location in the search bar at the top of the window. You'll see options like “This Mac,” “Current Folder,” or a shared folder. Pick the one that covers where your files live.
  5. Click the “Kind” dropdown (it may already say “Kind” or show a magnifying glass icon). If you don't see it, click the “+” button on the right side of the search bar to add a search criteria row.
  6. Select “Other…” from the dropdown menu. This opens a sheet listing all possible file attributes.
  7. Check the box next to “File Extension” (or “Extension”) and click “OK.” This adds a new search criterion that lets you filter by the exact file extension.
  8. In the new row, set the first dropdown to “File Extension” (if it isn't already), the second to “is” (or “matches”), and type the extension in the text field—for example, jpg (without the dot). Press Return.
  9. Review the search results. Finder will now show all files with that extension in the chosen location. If you want to narrow further (e.g., only files in a specific subfolder), you can add more criteria like “Name” or “Date Modified.”
  10. Select all the files by pressing Command + A (or choose Edit > Select All from the menu bar).
  11. Move them to Trash by pressing Command + Delete, or right-click one of the selected files and choose “Move to Trash.”
  12. Empty the Trash to permanently delete them: right-click the Trash icon in the Dock and choose “Empty Trash,” or open Trash and click “Empty” in the top-right corner. Confirm when prompted.

That's it. The files are gone. If you want to keep them but just get them out of the way, you could instead select them and drag them to a folder you create for “to-delete” items.

Common Mistakes

  • Forgetting to set the search location. If you leave it on “This Mac,” you might delete files from system locations you didn't intend. Always double-check the location before selecting all.
  • Using the wrong extension. For example, .jpg and .jpeg are different. If you type jpg, you won't get jpeg files. Use jpeg or search for both by adding two criteria (one for each) with “or” logic.
  • Deleting files you need. The search results include every file with that extension, even ones inside app bundles or system folders. Always review the list before deleting.
  • Not emptying the Trash. Files in the Trash still take up space. Empty it to free up storage.

Tips

  • Save the search as a Smart Folder. After you've set up the search, click “Save” in the search bar and give it a name. The smart folder will always show all files of that type, so you can quickly delete new ones later.
  • Use “Name” instead of “Extension” if you prefer. Some users find it easier to type *.pdf in the Name field. That works too—just make sure the search is set to “Name” and “matches.”
  • Be careful with “This Mac” searches. They include system files. If you're unsure, start with a specific folder like your Documents or Downloads folder.
  • Sort by “Kind” or “Date” in the results. This can help you spot files you want to keep before selecting all.

Troubleshooting

If the search doesn't find files you know exist:

  • Check that you typed the extension correctly without a dot. For example, pdf not .pdf.
  • Make sure the search location is set to the folder where the files are. If you're searching “This Mac,” it should find them, but it may take a moment.
  • If you're using “File Extension,” try using “Name” instead and type *.pdf (the asterisk is a wildcard).

If the “File Extension” option doesn't appear:

  • In the “Other…” sheet, use the search field at the top to type “extension.” It should show up. Make sure the checkbox is ticked, then click OK.

If you accidentally delete the wrong files:

  • Immediately press Command + Z to undo the move to Trash (if you haven't emptied it). Or open the Trash, right-click the file, and choose “Put Back.”
  • If you've already emptied the Trash, you may need a Time Machine backup or a data recovery tool, but those are not guaranteed.

Frequently Asked Questions

Can I delete all files of a type without using search?

Yes, but it's tedious. You can sort a folder by “Kind” or “Name” and manually select all files with the same extension. The search method is faster and less error-prone.

Will this delete files inside apps or system folders?

If you search “This Mac,” yes, it can include files inside app bundles or system directories. That's why it's safer to limit the search to a specific folder you control. Deleting system files can break apps, so always review the results.

Does this work for hidden files?

Finder search does not show hidden files by default. If you need to delete hidden files (like .DS_Store), you'd need to use Terminal commands instead, which is beyond the scope of this guide.

Can I delete files of multiple types at once?

Yes. Add multiple search criteria: click the “+” button, set the first to “File Extension” and “is” and type the first extension, then click the “+” again, change the dropdown to “Any” (or “or”), and add the second extension. This will show files matching either.

What if I want to keep some files but delete others?

After the search results appear, hold down Command and click the files you want to keep to deselect them, or use Shift to select a range. Then delete only the selected ones.

Is there a way to permanently delete without going to Trash?

Yes, but it's risky. You can press Option + Command + Delete to delete immediately without moving to Trash. This bypasses the Trash entirely, so there's no undo. Use only when you're absolutely sure.