Eject all external disks at once on Mac
Safely unmount every ejectable volume — USB drives, SD cards, DMGs — in one step.
01Command
$ osascript -e 'tell application "Finder" to eject (every disk whose ejectable is true)'02What it does
The AppleScript asks Finder to eject every disk whose ejectable property is true, which uses the same safe-unmount path as dragging a disk to the Trash. Volumes with open files refuse to eject and stay mounted, so nothing in use gets pulled out from under an app. Bind it to a keyboard shortcut or alias (e.g. "bye") for a one-keystroke cleanup before unplugging your dock.
03Risk
04Undo
✓No undo needed — this command does not change persistent state.
05Sources
- macOS osascript command referenceEvidence: osascript runs AppleScript from the Terminal; Finder's eject command safely unmounts every ejectable disk.
Last verified: 2026-09-16 · Category: System & Settings
06Related solutions
Point macOS screen captures at any folder you choose instead of the desktop.
Grab any file from the web straight into the current folder — no browser needed.
List the biggest files in your home folder that are eating disk space.