Files in Downloads you never opened: finding them with Spotlight's last-used date

By the Zofle team · 14 November 2026 · 5 min read

Bar chart: only 24 of 647,363 files in a home folder have a Spotlight last-used date

Spotlight stores a "last used" date for files you open, and <code>mdfind</code> can list the files that never got one. That sounds like the perfect way to find forgotten downloads. We tested it on a real Mac (macOS 27.0.1, 13 to 14 November 2026) and it works, with one big catch: the date is only set by some ways of opening a file. Here is what we measured, the one-line command, and how to use it without deleting something you did use.

The two dates Spotlight keeps

AttributeWhat it meansHow to read it
kMDItemDateAddedWhen the file arrived in that foldermdls -name kMDItemDateAdded file
kMDItemLastUsedDateLast time a Mac app opened it through the system (null if never)mdls -name kMDItemLastUsedDate file
kMDItemWhereFromsThe web address a browser download came frommdls -name kMDItemWhereFroms file

Files you made yourself, or copied in, also get a date added, but a browser download carries a "where from" too. That one is handy later: it tells you where to re-download a file you remove.

Our test: what sets the last-used date

We created six identical 0.4 MB text files in a scratch folder in Downloads, waited for Spotlight to index them, then opened each in a different way. We checked the date 25 seconds later.

FileWhat we didLast-used date after
a-untouched.txtNothingnull
b-cat.txtcat file > /dev/nullnull
c-open.txtopen file (default app, like a double-click)set (19:33:46 UTC)
d-openTextEdit.txtopen -a TextEdit fileset (19:33:49 UTC)
e-quicklook.txtQuick Look preview (qlmanage -p) for 4 secondsnull
f-dd-read.txtdd read of the whole filenull

So the date means "opened by an app through macOS", not "read by anything". Reading, copying, a Quick Look peek and Terminal tools leave it empty. A file you only ever previewed with the space bar still looks never opened. (The use count attribute read 4 on both opened files after one open each, so don't treat it as a count of your visits.)

How common is the date on a real Mac?

We counted what Spotlight knows about the home folder of the Mac we tested on:

Query (home folder)Count
Files and other non-folder items647,363
...with a last-used date24 (0.004%)
Apps in /Applications21
...of them with a last-used date9
Files in Downloads (6 real ones, excluding our test folder)0 with a date

Most of that home folder is code and caches, which nobody "opens" through macOS, so the tiny share is not a surprise. For Downloads it matters, though: all six real files there, a 256 MB disk image, a 173 MB zip, a PDF and three small certificate and key files, show no last-used date. Downloaded on 13 October, 9 November and 18 October, they might have been used from Terminal or Xcode, or not at all. The date alone can't tell you which.

The command

This lists everything in Downloads with no last-used date, biggest first, with its modified date. It only reads.

bash
mdfind -onlyin ~/Downloads \
  '! kMDItemLastUsedDate == "*" && kMDItemContentType != "public.folder"' -0 \
  | xargs -0 stat -f '%z\t%Sm\t%N' -t '%Y-%m-%d' \
  | sort -rn \
  | awk -F'\t' '{n=split($3,p,"/"); printf "%8.1f MB  %s  %s\n",$1/1048576,$2,p[n]}'

On our Downloads folder it printed:

text
   256.3 MB  2026-10-14  Pilotbase-3.0.0-beta11-mac-x64.dmg
   173.1 MB  2026-11-10  poochi-ios-0.3.zip
     0.8 MB  2026-10-18  Apple_Developer_Program_License_Agreement_LC644S5URF.pdf
     0.0 MB  2026-10-12  developerID_application.cer
     0.0 MB  2026-10-12  developerID_application (1).cer
     0.0 MB  2026-10-27  AuthKey_C6R5776228.p8

Variations that worked in our test:

  • Used lately: kMDItemLastUsedDate >= $time.today(-30)
  • Over 1 MB and added more than 30 days ago: ! kMDItemLastUsedDate == "*" && kMDItemDateAdded < $time.today(-30) && kMDItemFSSize > 1000000
  • Count only: add -count

Two details we had to fix on the way: the "not set" test is <code>! kMDItemLastUsedDate == "*"</code> (a plain comparison with null returns nothing), and filtering with <code>kMDItemKind != "Folder"</code> still let folders through, so use the content type <code>public.folder</code> instead.

Before you delete anything from the list

  • A never-opened file can still matter. A signing certificate, an API key file or a license PDF is opened by a tool, not an app, so it has no date. Our list has three of those. Look at what each is first.
  • Check "where from". If kMDItemWhereFroms shows a normal download address you can fetch again, it is cheap to remove. If it is empty, nobody can get it back for you.
  • Look at the date added. A 270 MB installer from this week may be one you haven't got to yet.
  • Use the Trash, not rm. Move reviewed files to the Trash and give it a week before you empty it.

Where the date can mislead you

  • Files opened from Terminal, scripts, Xcode or a build tool stay "never opened".
  • Files opened before Spotlight indexed the folder, or on a drive Spotlight doesn't index, can show nothing.
  • A file moved in from another Mac may carry the date its other Mac recorded, or none.
  • An external drive with Spotlight off gives no answer at all; use modified dates there.

For a general order of what to review first, see <a href="/articles/safe-files-to-clean-up-mac-windows-linux">safe files to clean up</a>.

Zofle, our free Mac app, lists big old files in Downloads and elsewhere so you can review them by size and age, and move them to the Trash with an undo.

Download Zofle for Mac

Sources

  • Our own tests on macOS 27.0.1, 13 to 14 November 2026: six scratch files opened six ways, and read-only mdfind counts over one home folder.
  • Apple, mdfind and mdls man pages on macOS (query syntax and the $time variables).

Zofle Pro news

People signing up now will get Zofle Pro, with more features, for free when we launch it.

One email when it's ready. No spam, ever.