How To Eject a Volume from the Terminal Command Line in MacOSX
![Calendar](https://www.ericmichaelstone.com/wp-content/themes/me3/images/calendar.png)
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 |