LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   accessing files with spaces (https://www.linuxquestions.org/questions/linux-general-1/accessing-files-with-spaces-869316/)

j360 03-17-2011 10:59 PM

accessing files with spaces
 
How do I access files with spaces from the command line?
for example I want to go to a file called "New File" and let's say is in Downloads/Books/(and here is the file)
how do I input the space since the command line doesn't recognize it? Thanks
:newbie:

kforbus 03-17-2011 11:33 PM

You could try escaping with the "\" character. Ex.: Downloads/Books/Your\ file\ with\ spaces
Or you could simply try putting quotes around the path.

Telengard 03-18-2011 12:26 AM

Code:

foo$ touch backslash\ escaped
foo$ touch 'single quoted'
foo$ touch also' 'single' 'quoted
foo$ touch "double quoted"
foo$ touch also" "double" "quoted
foo$ touch a\ "combination of"the' 'three
foo$ ls -1
a combination ofthe three
also double quoted
also single quoted
backslash escaped
double quoted
single quoted
foo$

:study: Bash Reference Manual, 3.1.2 Quoting


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