# See what has files open on a disk, and eject the one that is stuck.

Canonical page: https://vitalsmac.com/features/open-files

macOS says a disk was not ejected because one or more programs may be using it, and often does not say which. Vitals lists every disk with the apps and programs holding files on it, by name, and Quit Them and Eject does the rest once you say yes.

## Disks: Every disk, and whether it can be ejected.

Each connected disk is a card: its name, whether it is internal, external or on the network, how many files are open on it, and In Use or Ready to Eject. Pick one to see who holds it.

- Internal, external and network disks
- In Use, or Ready to Eject
- How many files are open on each
- Eject from the card, as Finder does

## Who holds it: The apps holding a disk, with the files they hold.

Under the disk is every app and program with something open on it: the folder it is working in, how many files it has open, how many of them for writing, and whether it runs from that disk. Helper processes count under their app.

- Working folder, open files, files open for writing
- A Terminal tab sitting in a folder on the disk
- Spotlight and Time Machine, named for what they are doing
- Show a file in Finder, or its app in Vitals

## Eject: Quit what holds it and eject, in one step.

Quit Them and Eject names the apps it will quit and asks. It quits them the way ⌘Q does, then ejects the disk. An app can still ask you to save, and if one does not quit, Vitals says which.

- Names what it will quit, and asks first
- Apps quit as ⌘Q does, so they can ask to save
- Tries again while macOS lets go
- Says when the disk is safe to unplug

## Find a file: Type a file name and see who has it open.

The filter searches every open file on every disk. Type part of a name or a path and the apps holding a match are listed. It is also how to find what has a file open when the Trash says the item is in use.

- Search by file name or path
- Across every disk at once
- The app, and the process inside it
- Ask an assistant, or vitals files in the terminal

## Why it matters: open files on a Mac

A disk that will not eject is one of the Mac's oldest annoyances. Finder says one or more programs may be using it and, often, not which. The answer is in Terminal: lsof with the disk's path, a list of process names and numbers, and then a hunt for the app each one belongs to.

So people pull the cable and hope, or click Force Eject and risk the file that was being written.

Open Files, a section of Vitals' Developer tab, lists every disk with the apps and programs holding files on it, by name, with the files. Quit them from there, or let Quit Them and Eject do it and eject the disk once they have gone. Nothing is quit until you say so.

## How to use it

1. **Open the Developer tab and choose Open Files.** Every connected disk is listed with how many files are open on it and whether it is ready to eject. Vitals picks the first external disk for you.
2. **See who holds the disk.** Under the disk are the apps and programs with something open on it. Open one to see its files, and how many are open for writing.
3. **Quit them and eject.** Click Eject on a disk that is in use and Vitals names what it will quit. Say yes and it quits them, ejects the disk and tells you it is safe to unplug.
4. **Find one file.** Press ⌘F and type part of a file's name or path. Whatever has it open is listed, on any disk.

## Compared with Activity Monitor

| | Activity Monitor | Vitals |
| --- | --- | --- |
| Open files | Per process, behind a double-click | By disk and by app |
| What stops an eject | Not shown; lsof in Terminal | Named, with the files it holds |
| Ejecting | Finder, or Force Eject | Quit Them and Eject, after a confirmation |
| Finding a file | No search across processes | Filter every open file by name or path |
| macOS processes | Shown by name only | Spotlight and Time Machine, said in plain words |

## The words behind it

- [Open Files and Ports](https://vitalsmac.com/glossary/open-files-and-ports): Open Files and Ports is a tab in the window Activity Monitor opens for a single process.
- [lsof](https://vitalsmac.com/glossary/lsof): lsof is a Terminal command that lists the files, folders and network connections every process has open.
- [mds_stores and mdworker](https://vitalsmac.com/glossary/spotlight-indexing): mds, mds_stores and mdworker are the macOS processes that build and maintain the Spotlight search index.
- [backupd](https://vitalsmac.com/glossary/backupd): backupd is the Time Machine backup process in macOS.
- [Force Quit](https://vitalsmac.com/glossary/force-quit): Force Quit ends an app or process immediately, without letting it save or clean up.

## Questions

### Why can't I eject my external drive?

Something still has a file or a folder open on it: an app with a document, a Terminal tab working in one of its folders, or macOS indexing it or backing up to it. Open Files names each one, with the files it holds.

### How do I see which app is using a file?

Open the Developer tab, choose Open Files, press ⌘F and type part of the file's name or path. Every app holding a file that matches is listed, on whichever disk it is.

### Does Vitals force eject a disk?

No. It quits the apps you agree to quit, the way ⌘Q does, so an app can ask you to save first, then ejects the disk as Finder does. If something will not let go, Vitals says what it is.

### What about Spotlight and Time Machine?

They are named for what they are doing: Spotlight indexing the disk, Time Machine backing up to it. macOS's own processes usually let go within a few seconds, and Vitals tries again while they do.

### Why are some of macOS's processes left out?

Without Full System Metrics, Vitals cannot read the files of the processes macOS runs itself, such as Spotlight's, and says how many it left out. Turn it on in Settings → Permissions and they are listed too.

### Does it show files on the startup disk too?

Yes. Every disk is listed, the startup disk included. Open an app under it to see its files, and how many are open for writing.

### Can my assistant or a script ask?

Yes. Over MCP an assistant can ask what is holding a disk or a file, and `vitals files` answers the same in the terminal.

### Is it the same as lsof?

It reads what lsof reads, every process's open files, and groups them by disk and by app, with helper processes counted under the app they belong to.

## Read on

- [Mac won’t eject an external drive? How to find what is using it](https://vitalsmac.com/mac-cant-eject-disk)
- [How to find which app is using a file on a Mac](https://vitalsmac.com/which-app-is-using-a-file-mac)
- [Vitals vs Activity Monitor](https://vitalsmac.com/vs/activity-monitor)

## More of Vitals

Every feature is at [vitalsmac.com/features](https://vitalsmac.com/features). Vitals is paid once, with a year of updates or every update for life: [pricing](https://vitalsmac.com/pricing).
