Skip to main content
Became Hot Network Question
edited title
Link
David Anderson
  • 42k
  • 14
  • 67
  • 111

How can I determine the volume name of the default boot disk from Terminal?

Source Link
luckman212
  • 3.7k
  • 3
  • 29
  • 41

How can I determine the volume name of the boot disk from Terminal?

I have some shell scripts that need to access paths under /Volumes/ e.g. /Volumes/MyDisk/tmp/foo.json. Right now the scripts have hardcoded volume names. I would like to make them portable so they run correctly on my various machines, all of which have different disk names for the boot volume.

Can anyone post a reliable method for getting the disk name of the system on a modern macOS system? (13.0.1 as of this writing)