Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


  Search this Thread
Old 03-17-2011, 10:59 PM   #1
Registered: Jan 2010
Location: Maryland
Distribution: Ubuntu
Posts: 58

Rep: Reputation: 0
Cool 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
Click here to see the post LQ members have rated as the most helpful post in this thread.
Old 03-17-2011, 11:33 PM   #2
Registered: Sep 2009
Location: Maryland
Distribution: Slackware
Posts: 68

Rep: Reputation: 28
You could try escaping with the "\" character. Ex.: Downloads/Books/Your\ file\ with\ spaces
Or you could simply try putting quotes around the path.
2 members found this post helpful.
Old 03-18-2011, 12:26 AM   #3
Registered: Apr 2007
Location: USA
Distribution: Kubuntu 8.04
Posts: 579
Blog Entries: 8

Rep: Reputation: 148Reputation: 148
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
Bash Reference Manual, 3.1.2 Quoting
1 members found this post helpful.


command line, escape, quoting

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Accessing my Contact's MSN Spaces with Gaim win32sux Linux - Software 2 12-29-2005 03:54 PM
files that have spaces in their names hesher Linux - Software 5 01-14-2005 01:43 PM
accessing Directorys and files with spaces paintcheck200 Linux - General 2 01-07-2004 07:07 PM
Files with spaces in their names downinthemine Linux - General 3 12-12-2003 01:48 PM
Rename files with spaces buzzbuzz Linux - General 26 08-15-2003 06:23 AM > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 03:41 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration