LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 05-19-2010, 07:24 PM   #1
newbiesforever
Senior Member
 
Registered: Apr 2006
Distribution: MX (desktop: XFCE 4)
Posts: 2,170

Rep: Reputation: 77
are double quotation marks allowed in filenames?


Never mind; I solved my own problem. I was asking:
Quote:
I tried to move a file from my desktop to another folder; moving it was not allowed, for some reason. Neither was opening it and saving a new copy in the target folder. Would that be because the filename contains double (") quotation marks? Are they not allowed? The filename is Edit of Bob's "Lady Liberty" Article.doc. [Filename not enclosed in quotation marks here, to avoid confusion.]
I just changed the double quotation marks to single quotation marks; that solved everything.

Last edited by newbiesforever; 05-19-2010 at 07:26 PM.
 
Old 05-19-2010, 07:33 PM   #2
AlucardZero
Senior Member
 
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,824

Rep: Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615
Yes they are. But you then have to escape the quotes.
Code:
ls Edit of Bob's \"Lady Liberty\" Article.doc
 
Old 05-20-2010, 06:00 AM   #3
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,577
Blog Entries: 31

Rep: Reputation: 1196Reputation: 1196Reputation: 1196Reputation: 1196Reputation: 1196Reputation: 1196Reputation: 1196Reputation: 1196Reputation: 1196
Quote:
Originally Posted by AlucardZero View Post
Yes they are. But you then have to escape the quotes.
Code:
ls Edit of Bob's \"Lady Liberty\" Article.doc
I think that's a typo for
Code:
ls "Edit of Bob's \"Lady Liberty\" Article.doc"
Alternatively (and this is how bash command completion will do it for you if you type ls E and then press the tab, twice if E* is not unique):
Code:
ls Edit\ of\ Bob\'s\ \"Lady\ Liberty\"\ Article.doc
Having both single and double quotes in the name makes it harder. Without the single quote you could single quote the name:
Code:
ls 'Edit of Bobs "Lady Liberty" Article.doc'
Or you can double quote the part with the single quote and single quote the part with the double quotes:
Code:
ls "Edit of Bob'"'s "Lady Liberty" Article.doc'
A file name may contain any character except / and NUL (ASCII 0).

Last edited by catkin; 05-20-2010 at 06:02 AM. Reason: Forgot to escape '
 
  


Reply


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
can not input double quotation marks(invalid quotation key) wangzhilife Linux - Hardware 2 09-18-2009 06:44 AM
nested `` quotation marks deathalele Programming 2 03-16-2009 01:31 PM
Use of quotation marks in bash dunryc Programming 2 06-08-2008 02:24 PM
Execvp With Quotation Marks amitbern Programming 10 11-25-2005 10:28 AM
no quotation marks jdoe9898 Linux - Newbie 1 10-12-2005 03:07 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 03:34 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration