LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
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.

Notices



Reply
 
Search this Thread
Old 03-17-2011, 11:59 PM   #1
j360
Member
 
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-18-2011, 12:33 AM   #2
kforbus
Member
 
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, 01:26 AM   #3
Telengard
Member
 
Registered: Apr 2007
Location: USA
Distribution: Kubuntu 8.04
Posts: 579
Blog Entries: 8

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


Reply

Tags
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 04:54 PM
files that have spaces in their names hesher Linux - Software 5 01-14-2005 02:43 PM
accessing Directorys and files with spaces paintcheck200 Linux - General 2 01-07-2004 08:07 PM
Files with spaces in their names downinthemine Linux - General 3 12-12-2003 02:48 PM
Rename files with spaces buzzbuzz Linux - General 26 08-15-2003 07:23 AM


All times are GMT -5. The time now is 06:45 PM.

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