3 Replies Latest reply: Dec 2, 2007 5:26 PM by nerowolfe
Yong Taek Hwang Level 1 Level 1
hi

how to change directory in Terminal (ex. cd System HD)
i wrote cd system hd, which did not work. Terminal understood it as cd system.
is there some character to write a "space" between words?

thanks

MacBook, Mac OS X (10.4.11)
Solved by brainslice on Dec 2, 2007 4:43 PM Solved
You need to escape the spaces with a leading backslash or the shell will give you unexpected results. For example to cd to "folder with spaces"cd folder\ with\ spaces/Also, the bash tab-auto-complete is your friend. Type a character or two and then tab, you'll get the idea when you see the result. If there is more than one possible completion, then hit tab a couple of times quickly and you'll get a list of all of the options.hth
Reply by nerowolfe on Dec 2, 2007 5:26 PM Helpful
As an aside, parenthesis also work when spaces are present.I do it using the wildcard *In your example, cd *fold (of course it has to be a unique folder/filename)That comes from years of Linux training and a strong dislike of typing.

All replies

  • brainslice Level 2 Level 2
    You need to escape the spaces with a leading backslash or the shell will give you unexpected results.

    For example to cd to "folder with spaces"

    cd folder\ with\ spaces/

    Also, the bash tab-auto-complete is your friend. Type a character or two and then tab, you'll get the idea when you see the result. If there is more than one possible completion, then hit tab a couple of times quickly and you'll get a list of all of the options.

    hth
  • Yong Taek Hwang Level 1 Level 1
    thanks
    great help !!!
  • nerowolfe Level 6 Level 6
    As an aside, parenthesis also work when spaces are present.
    I do it using the wildcard *
    In your example, cd *fold (of course it has to be a unique folder/filename)
    That comes from years of Linux training and a strong dislike of typing.