Originally Posted by
herbsman
How the heck do I go inside a directory that has spaces or multiple words? i.e. all I want to do is navigate inside a folder titled Nature Documentaries via terminal.
This may be more information then you were looking for, but for the sake of being complete:
The other poster mentioned part of the answer, but there are several ways to handle filenames with spaces or other characters that have secondary meanings to the shell.
1) You can "escape" the offending character. The standard shell escape character is "\". Any special character preceded by a backslash will be used literally and not interpreted. As the other poster mentioned, you can
cd Nature\ Documentaries
2) You can quote the string. There are two kinds of quotes for this purpose: single and double quotes. Single quotes interpret their contents literally. Double quotes still allow for variable substitution. As a result, you could
cd "Nature Documentaries"
-or-
cd 'Nature Documentaries'
However, due to the subtle difference with variable handling, cd "$HOME" will go to your home directory, while cd '$HOME' will look for a directory called $HOME.
3) There is a special case with the "-" character. If it starts a word, most programs will attempt to treat it as an option and not a filename. If your example was named "-Nature Documentaries" you need to let the command line know that "-Nature" isn't a program option with "--".
cd -- "-Nature Documentaries"
4) Of course, you can use wildcards if only one item will match.
cd Nature?Documentaries
-or-
cd Nature*
5) Lastly, if you're using quotes, the entire program argument needs to be quoted. This is different than Microsoft Windows command line
cd "/Users/Your Name/Nature Documentaries"
not
cd /Users/"Your Name"/"Nature Documentaries"