Changing directories in Terminal

sahyun

Registered
How do you change directories with multi-word names when using the Terminal app? For example if I wanted to change to a directory called "My File", if I use

cd My%20File

I get a directory does not exist error. The only work-around I've found is to rename the file in the finder to a name that doesn't have a space, hardly a reasonable route.

Thanks,
Steve
 
With the default tcsh we've got tab-completion. What that means is that if you're trying to change into a directory called "My Directory" you can just type

<tt>cd My[TAB]</tt>

and it will fill in the rest. This assumes that you do not have any other directories that start with "My " in the current directory.

If you do have something else that starts with "My ", or if you are using a shell that does not have any kind of completion, then you would escape the space with the backslash:

<tt>cd My\ Directory</tt>

 
Back
Top