9

What is the best way to change drives through command line on a mac?

2 Answers 2

16

What do you mean by change drives?

If you mean changing directory so that you can use the files on an external drive, they're mounted in /Volumes, so if you wanted to work in the root of a disk called Foo, you'd go cd /Volumes/Foo.

If you mean ejecting a drive so you can unplug it, hdiutil unmount /Volumes/[drive name] is what you want, so to unmount a disk called Foo, you'd go hdiutil unmount /Volumes/Foo.

3
  • 1
    There is no such thing as drive letters, one working directory per drive and the need to type e.g. C: on Mac OS X, as there is on Windows.
    – Daniel Beck
    Jan 24, 2011 at 10:35
  • I'm not sure where you got the idea that I was talking about drive letters - hopefully things are clearer now.
    – Scott
    Jan 24, 2011 at 10:42
  • Sorry, meant that as an addition, as I suspect this concept caused the user's confusion (but your edit is useful anyway). If you reply to comments, please use @-syntax, e.g. @DanielBeck or @Daniel, so the user you reply to gets a notification.
    – Daniel Beck
    Jan 24, 2011 at 10:45
7

You don't; you just go to another mounted volume.

cd /Volumes/"Some Volume Name Here"

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .