Is there a way to eject all the mounted hard drive volumes on an OS X computer from the command line? Applescript is OK if I can wrap that in a shell script.
相关问题
- Xcode debugger displays incorrect values for varia
- Is there a way to report errors in Apple documenta
- Advice for supporting both Mac and Windows Desktop
- softlinks atime and mtime modification
- Avoid cmake to add the flags -search_paths_first a
相关文章
- 现在使用swift开发ios应用好还是swift?
- Visual Studio Code, MAC OS X, OmniSharp server is
- xcode 4 garbage collection removed?
- IntelliJ IDEA can't open projects or add SDK o
- Automator: How do I use the Choose from List actio
- ImportError: No module named twisted.persisted.sty
- How can I vertically align my status bar item text
- Compile and build with single command line Java (L
In Terminal try:
umount -a
(All the filesystems described via getfsent(3) are unmounted.)umount -A
(All the currently mounted filesystems except the root unmounted.)Fore more information see
man umount
.Update:
Seems like you can also use this:
Didn't test it, though. If it doesn't work, try to use "unmount" instead of "unmountDisk".
Oh, I also found the
eject
argument (instead ofunmountDisk
). That might also be of interest.Update 2:
diskutil eject /dev/*
seems what you are looking for (see comments).You can also use
diskutil eject /dev/disk2
or whatever your device number is you want to eject. That worked for me.There is another elegant way to unmount all external hard drives without knowing the exact names:
To ignore network mounts and optical disks, use:
I found this to work for ejecting all dmg and physical hard drives:
I do it like this: