Skip to content

Mac file guides

How to find every file downloaded from one website on a Mac

By · Updated · 4 min read

Short answer

Spotlight indexes each download’s “Where from” address, so you can search by it. In Finder, press ⌘F, add the Where from attribute via Other…, and type the site’s name. In Terminal, mdfind 'kMDItemWhereFroms == "*example.com*"c' lists every file whose source mentions that site. Save the Finder search to keep the list live.

How do I search Finder by the website a file came from?

  1. 1Open a Finder window, press ⌘F and click This Mac.
  2. 2Open the first menu of the search rule and choose Other….
  3. 3Type “where” in the attribute search box, tick Where from, and click OK.
  4. 4Set Where from › contains › the site’s name, for example github.com.
  5. 5Click Save to keep it as a Smart Folder in the sidebar.

Add a second rule with + (Kind is PDF, say) to narrow it to one kind of file from that site.

What’s the Terminal command?

mdfind -onlyin ~ 'kMDItemWhereFroms == "*example.com*"c'

The asterisks match anything before and after the name, and the c after the closing quote ignores case. Swap -onlyin ~ for -onlyin ~/Downloads to look in one folder, or add -count to get a number instead of a list.

Which address should I search for?

“Where from” usually holds two addresses: the file’s own URL and the page you were on when you saved it. A search matches either, which matters because many sites serve files from a different host. A Gmail attachment’s file URL is on googleusercontent.com, but its page is mail.google.com, so searching for mail.google.com finds your saved attachments.

Search for the part of the address you remember. A broad term like google catches Gmail, Drive and Search Console downloads together; a full host name keeps them apart.

How much space do one site’s downloads take?

mdfind -0 -onlyin ~ 'kMDItemWhereFroms == "*example.com*"c' | xargs -0 du -ch | tail -1

It prints a single total. Drop | tail -1 to see each file’s size too. Nothing is moved or deleted.

Why are some files from that site missing?

  • The app that saved them didn’t record a source, so there is nothing to match.
  • They were unzipped from a download or exported from an app. Only the original download carries “Where from”.
  • The folder or drive is excluded from Spotlight, or hasn’t been indexed yet.
  • The source was removed on purpose with xattr, which some people do before sharing a file.

Every site’s downloads in one place, in Peekaboo

Finder and mdfind need the site’s name before they can search. Peekaboo’s Downloaded From works the other way round: it reads the same “Where from” data and groups your downloads by source domain, with named groups for Gmail, Drive, ChatGPT, Canva, X, Slack, WhatsApp and GitHub, and one for any other website. You see every site you’ve downloaded from, then pick one.

  1. 1Open Downloaded From and pick a site.⇧⌘J
  2. 2Or search by source: “pdfs from gmail”.⌘F
  3. 3Moved a site’s files to the Trash and need one back? Put it back.⌥⌘Z

Questions

Do files keep their “Where from” if I move them?

Yes, when you move or rename them on your Mac: the address is stored with the file. Unzipping, exporting or re-saving from an app creates a new file without it.

Can Spotlight in the menu bar search by website?

Not reliably. Typing a site name there searches names and contents too, so results are mixed. Finder’s Where from rule and mdfind look only at the download source.

How do I check one file instead of a whole site?

Select it and press ⌘I; “Where from” is under More Info. Our guide to seeing where a file was downloaded from covers that in detail.

Sources

Your privacy choices

With your permission, Google Analytics measures visits to this site using cookies. Privacy policy.