Getting files back
macOS is telling the truth: some process has the file open. The error's failure is not saying which one. The lsof command answers in a second, and the answer is usually one of four things.
lsof /path/to/stubborn-file
The output names every process holding the file. That is the whole diagnosis. Quit the named app and the deletion proceeds.
mounted. Eject the volume in Finder's sidebar first.
preview windows; select a different file.
Pause syncing, delete, resume.
background tab you forgot. lsof names it either way.
The hold may be a zombie: an app quit uncleanly and the kernel has not released the handle. Relaunching Finder (⌥-right-click its Dock icon → Relaunch) clears Finder's own holds; logging out clears almost everything; restarting clears everything. Escalate in that order — a restart for one file is usually unnecessary.
The same error at empty-Trash time means something in the Trash is held open. Either lsof the specific file, or bypass with an immediate delete: select the file, then ⌥⌘⌫ deletes without the Trash stage entirely — appropriate once you know why the hold existed.
It lists open files. Given a path, it prints every process with that file open — turning the vague in-use error into a specific app name.
Restarting releases all holds and the delete then succeeds. It works; it is also the slowest possible way to close one file handle.
Everywhere keeps track of every file on your Mac — including the folders Spotlight hides and drives you have unplugged. Free for a day, then $19 once.
Download for MacVersion 2.15.7 · macOS 13+ · 3.8 MB · notarised