How do I designate a "space" in Terminal...

Discussion in 'Mac Basics and Help' started by orbdrums, Feb 21, 2012.

  1. orbdrums macrumors member

    Joined:
    Dec 13, 2008
    #1
    If I have a directory called "Automator Workflows", how would I structure the cd command in terminal to get to that directory. I can get to any directory that is a single name but don't know how to get to the directories with a "space".
    Thanks.
     
  2. chown33 macrumors 604

    Joined:
    Aug 9, 2009
    #2
    Supposing it's in your Documents folder. Then:
    Code:
    cd "Documents/Automator Workflows"
    
    Google search terms: shell quoting

    There are literally hundreds of other ways to quote the pathname with a space. I find double-quotes usually suffice, though there are times when they don't.

    You could also just type cd in Terminal, then type a space, then drag the Finder icon for "Automator Workflows" to the Terminal window. Terminal will expand the dropped file or folder to its full pathname.
     
  3. orbdrums thread starter macrumors member

    Joined:
    Dec 13, 2008
    #3
    ***solved***

    Thanks. The quotes worked great. I found that the following line worked as well: "cd Automator\ Workflows". The backslash precedes the "space".
     

Share This Page