Skip to content

Instantly share code, notes, and snippets.

@rene-d
Created May 15, 2021 09:42
Show Gist options
  • Save rene-d/c09974fad00e69d866f21bf08ed19943 to your computer and use it in GitHub Desktop.
Save rene-d/c09974fad00e69d866f21bf08ed19943 to your computer and use it in GitHub Desktop.
The missing eject command in macOS
alias eject="diskutil list | sed -nr '/external, physical/s,^/dev/disk([0-9]+) .*,\1,p' | xargs -I+ diskutil eject /dev/rdisk+"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment