changing the drive in terminal window

Discussion in 'macOS' started by lepinceau, Jun 2, 2009.

  1. lepinceau macrumors newbie

    Joined:
    Jun 2, 2009
    Location:
    Alberta
    #1
    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
     
  2. jsw Moderator emeritus

    jsw

    Joined:
    Mar 16, 2004
    Location:
    Andover, MA
    #2
    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
     
  3. Arne macrumors regular

    Joined:
    May 14, 2006
    Location:
    Germany
    #3
    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...
     
  4. spinnerlys Guest

    spinnerlys

    Joined:
    Sep 7, 2008
    Location:
    forlod bygningen
    #4
  5. lepinceau thread starter macrumors newbie

    Joined:
    Jun 2, 2009
    Location:
    Alberta
    #5
    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
     
  6. Mal macrumors 603

    Mal

    Joined:
    Jan 6, 2002
    Location:
    Orlando
    #6
    So you do cd /Volumes/"Macintosh HD 1" (the quotes are needed for the spaces, or you can do Macintosh\ HD\ 1 instead).

    jW
     
  7. Arne macrumors regular

    Joined:
    May 14, 2006
    Location:
    Germany
    #7
    another hint: you can often just hit tab to autocomplete commands and pathes after you have typed the first few letters
     

Share This Page