Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

share|improve this question
up vote 7 down vote accepted

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.

share|improve this answer
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 '11 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 '11 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 '11 at 10:45

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

cd /Volumes/"Some Volume Name Here"
share|improve this answer

You must log in to answer this question.

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