LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Change directory command (https://www.linuxquestions.org/questions/linux-newbie-8/change-directory-command-385837/)

gizmobay 11-23-2005 10:09 AM

Change directory command
 
Ok this should be an easy one but I can't figure it out. I have a directory called My Music (note the space). When I do a cd My Music, it says not found. How do I do a cd with a folder that has a space in the middle?

Thanks

Nylex 11-23-2005 10:12 AM

Use a \:

cd My\ Music

ethics 11-23-2005 10:30 AM

or cd my then hit tab would either auto complete if there's only one starting like that, or a few tabs shows the different directories, which would have shown you My\ Music

AdaHacker 11-23-2005 02:26 PM

Or just put the directory in quotes.
Code:

cd "My Music"

sundialsvcs 11-23-2005 06:11 PM

Both single and double quotes can be used ... slightly different but nearly the same ... and the backslash "\" character is always recognized as an escape-character, nullifying any special meaning of the character (including a space) that immediately follows it.

Incidentally, the same tricks are used on the command-line in Windows.

info bash is a very handy thing to read... lots of cool time-saving tricks in there.


All times are GMT -5. The time now is 04:51 AM.