changing the drive in terminal window

lepinceau

macrumors newbie
Original poster
Jun 2, 2009
2
0
Alberta
Hi I am a recent user of Mac and wondering about something. If I wanted to change the directory I am looking at in Command prompt in MSwindows I use a command, like unix/linux cd .. if I want to change the drive I want to explore in MS windows I use c: or d: or which ever drive I want to explore and then begin the exploration by using a dir or ls in the unix and cd to the folder.. how the .. hmmmmmm h..l would I change drive from my primary to my seconary using the terminal window.. with a Mac? OS 10.4?

appreciate any input.. :)

lepinceau
 

jsw

Moderator emeritus
Mar 16, 2004
22,909
41
Andover, MA
In Terminal, if you
Code:
ls /Volumes
you'll see all of your drives. You can then cd to one of them (or just cd directly - no need to list the volumes first). For example:
Code:
cd /Volumes/My\ Other\ Drive
Spaces are replaced by '\ '. Or you can put the whole thing in quotes:
Code:
cd /Volumes/"My Other Drive"
If the drive name has no spaces, then you'd just use the name:
Code:
cd /Volumes/MyOtherDrive
 

Arne

macrumors regular
May 14, 2006
172
0
Germany
there are no drive letters in unix-systems. all the drives are mounted into directoys. You can find all your mounted Volumes in /Volumes.

Just type cd /Volumes and then ls to see, wich volumes are available. then you can cd into those to access everything.

Edit: damn, jsw bet me...
 

spinnerlys

Guest
Sep 7, 2008
14,328
7
forlod bygningen

lepinceau

macrumors newbie
Original poster
Jun 2, 2009
2
0
Alberta
thanks for your help

ahhh so I tried your suggestions folks and I appreciate it. I actually tried cd /Volumes/the other drive
that said.. the other drive is named "Macintosh HD 1" and the root is named "Macintosh HD".. I am thinking that is my problem.. hmmmm any thoughts??

again thanks for you help

lepinceau
 

Mal

macrumors 603
Jan 6, 2002
6,249
17
Orlando
ahhh so I tried your suggestions folks and I appreciate it. I actually tried cd /Volumes/the other drive
that said.. the other drive is named "Macintosh HD 1" and the root is named "Macintosh HD".. I am thinking that is my problem.. hmmmm any thoughts??

again thanks for you help

lepinceau
So you do cd /Volumes/"Macintosh HD 1" (the quotes are needed for the spaces, or you can do Macintosh\ HD\ 1 instead).

jW
 

Arne

macrumors regular
May 14, 2006
172
0
Germany
another hint: you can often just hit tab to autocomplete commands and pathes after you have typed the first few letters
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.