If your Mac says a file is in use or won’t let you move it, start by checking the apps that may have it open. For a precise answer, use the built-in Terminal command lsof with the file’s full path; its output can identify the process holding an open reference. Then quit that app normally and try the file operation again. macOS does not provide a Finder button that always names the app responsible.

First, check whether the file is actually open

Apple recommends making sure an item isn’t open in another app when it can’t be moved or copied. Look at likely apps—such as a document editor, image viewer, media player, or a window showing a preview—and close the file from within the app. Save any changes first. If you see a lock icon on the file, that may be a separate document-lock setting; an open file and a locked file are different issues. Apple’s move and copy guidance describes both checks.

A Finder alert can sometimes name an app, but it may only report that the item is in use. Activity Monitor lists running apps and processes, and flags some unresponsive processes, but it is not a searchable list of which process has a particular file open. Use it to act on a process after you have a reason to suspect it, rather than guessing based on CPU or memory use.

Identify the process with Terminal

The lsof command means “list open files.” Its documentation includes finding processes using a specific file, and supports macOS. The lsof project documentation gives the basic form: lsof /path/to/file.

  1. In Finder, locate the file and choose File > Get Info to confirm its name and location. Build the full path from that location and the file name. Paths are case-sensitive where the disk format enforces it; spaces in a path are fine when the entire path is inside quotation marks.

  2. Open Terminal from Applications > Utilities, then run this command, replacing the example path with the real one:

lsof "/Users/yourname/Documents/Project Notes/report.pdf"
  1. Read the result. The COMMAND column gives the process or app name, and PID is its process ID. The NAME column should show the file path you queried. If more than one row or process appears, note all matching names: more than one process can have a file open. A process name may differ from the app’s familiar name, so search that exact name in Activity Monitor before deciding what to quit.

The command only reports references it can inspect. If it returns no matching rows, the app may already have released the file, your path may be wrong, or macOS may not let your user account inspect the relevant process. Check the path and retry while the warning is present. If you understand the command and need to inspect another user’s process, sudo lsof "/full/path/to/file" may request an administrator password; elevated access can reveal more, but should be used only for this read-only inspection. lsof’s documentation also cautions that it can miss files as process state changes. A blank result is not proof that no app ever used the file.

Quit the identified app safely

Save work and use the app’s Quit command first. If it does not respond, open Activity Monitor, find the process by name, select it, and click the Stop button. Choose Quit before Force Quit. Apple says Force Quit ends the process immediately; unsaved work can be lost, and other apps that rely on that process may have problems. Some processes belong to macOS or support other apps, so don’t force quit an unfamiliar system process just because it appears in the output. Apple’s Activity Monitor instructions explain the distinction and how to view processes hierarchically.

After quitting the likely holder, rerun lsof on the same path. If the matching process is gone, try moving, copying, or deleting the file again. If it remains, check the other matching process names and close their files normally before escalating.

If no app appears

A missing result does not establish that the problem is an app lock. Check that you’re querying the original file’s exact path, then consider other causes Apple documents: a locked item, insufficient space, destination permissions, or an external drive format that macOS can’t write to. On network or external storage, connectivity or volume state can also affect the operation. Restarting may clear a stale reference, but save work first and use it after checking the simpler causes. Apple’s troubleshooting steps for moving or copying items cover several of these alternatives.

The practical sequence is: verify the path, use lsof while the problem is happening, quit the identified app cleanly, and retry. Treat a force quit as a last resort, and treat an empty command result as inconclusive when permissions or changing process state could hide the holder.

Sources