Eject all external disks at once on Mac

Safely unmount every ejectable volume — USB drives, SD cards, DMGs — in one step.

macOSTerminalLow risk
Run the command below — Finder ejects every ejectable disk simultaneously and they disappear from the desktop and sidebar.

01Command

Command
$ 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

RiskLow risk
CompatibilitymacOS 10.11 El Capitan – 15 Sequoia
!Warning: Save and close files on external drives first — disks with open documents will refuse to eject.

04Undo

✓No undo needed — this command does not change persistent state.

05Sources

  • macOS osascript command reference
    SS64 · technical · 2026-09-16
    Evidence: 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