LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   directory with a space (https://www.linuxquestions.org/questions/linux-newbie-8/directory-with-a-space-221667/)

singedwings 08-24-2004 05:20 AM

directory with a space
 
In the console how do you access a directory that has a space in the name? i.e. a directory with the name system files

chrism01 08-24-2004 05:31 AM

Use spaces around the name eg: ls 'system files'.
Be aware that most Unix/Linux cmds do not cope well with this scenario ie try to avoid using spaces in names if possible.

edit: oops... yes i meant use quotes....
BTW, I think myriad-zero means leading backslash ie \
The advantage of using single quote marks is that if the dirname is stored in a variable. you don't have to parse it and insert the leading \'s.

myriad-zero 08-24-2004 05:37 AM

Two options to change to the directory with the name "system files"
Code:

# cd "system files"
or
Code:

# cd system\ files
Note that spaces need to be escaped with a leading '\'. This would be applicable for all commands to access the directory.

HTH.

Proud 08-24-2004 05:49 AM

I think chrism01 meant use quotation marks around the path string. There's many different types though (" ` ') and it isnt the best solution. I'm assuming the system files directory is on a mounted windows drive so it's probably best to not rename it, so be careful when manipulating it.

singedwings 08-24-2004 05:55 AM

Thanks that solved my problem.


All times are GMT -5. The time now is 10:51 PM.