How To Eject a Volume from the Terminal Command Line in MacOSX
erics, Posted December 8th, 2015 at 6:11:16pm
As always, YMMV…
1 2 3 4 5 6 7 8 9 |
#!/bin/bash # Usage: eject [fullpath to mount point] DISK="${1:-/Volumes/YourUSBFlashDriveName/}" df -h "$DISK" > /dev/null 2>&1 if [ $? -eq 0 ]; then diskutil unmountDIsk `diskutil list "$DISK" | grep ^/dev/` else echo Volume $DISK is not mounted...skipping. fi |
Leave Your Comment
All fields marked with "*" are required.