Identify connected external disks programmatically
-
30-10-2019 - |
Question
I want to write a shell script that ejects all currently-connected external drives (either USB or Firewire drives). I can use the disktuil eject <disk-path>
to eject a specified drive. But I still can't figure how to find out what are the external drives. For instance, /Volumes
shows internal drives, external drives, and mounted images. Is there a way to identify only external drives programmatically?
No correct solution
Licensed under: CC-BY-SA with attribution
Not affiliated with apple.stackexchange