LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices



Reply
 
Search this Thread
Old 12-20-2003, 02:14 PM   #1
cblamer
LQ Newbie
 
Registered: Dec 2003
Posts: 27

Rep: Reputation: 15
\ in filename


I have a directory with a space in it, it shows as Program\ Files in shell window, in Konqueror it shows as Program Files. I never saw this before with any other distros i had used, but just wondering if its normal, or whats ging on with it.

thanks
chris
 
Old 12-20-2003, 02:40 PM   #2
wapcaplet
Guru
 
Registered: Feb 2003
Location: Colorado Springs, CO
Distribution: Gentoo
Posts: 2,018

Rep: Reputation: 48
The backslash is there to "escape" the space that follows it. Usually a space is used to separate command-line arguments, like if you were copying "somefile" from, say, "Program Files" to "abc":

cp Program Files/somefile abc

The space would be interpreted incorrectly, thinking that you wanted to copy the file from "Program" to "Files/somefile". Anyhow, the backslash is used to tell bash, or other shells, that the space is part of the filename. The backslash is used for a lot of other things too. It basically means "the character that comes next should be treated literally," or sometimes "treat the next character in some special way." It's also used in some programming languages like C, for characters that you can't type in ASCII (such as \n for newline, \t for tab, etc.)

Last edited by wapcaplet; 12-20-2003 at 02:41 PM.
 
Old 12-20-2003, 02:47 PM   #3
Longinus
Member
 
Registered: Sep 2003
Distribution: Redhat 9.0 && Slackware 9.1
Posts: 420

Rep: Reputation: 30
well said wapcaplet

most people wouldnt explain all that lol
-like me
 
Old 12-20-2003, 02:50 PM   #4
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,005
Blog Entries: 11

Rep: Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903
That's normal ... the shell is escaping the " "
for you ... if the shell in other distro's doesn't
do it their defaults suck ;)


Cheers,
Tink
 
Old 12-20-2003, 03:01 PM   #5
cblamer
LQ Newbie
 
Registered: Dec 2003
Posts: 27

Original Poster
Rep: Reputation: 15
so basically it will allow me to "cp test.txt /c/Program\ Files" where Redhat (I think it was) made me do "cp test.txt "/c/Program Files" ???
 
Old 12-20-2003, 03:32 PM   #6
DaOne
Member
 
Registered: Jan 2003
Location: USA
Distribution: Slackware
Posts: 498

Rep: Reputation: 30
Quote:
Originally posted by Tinkster
That's normal ... the shell is escaping the " "
for you ... if the shell in other distro's doesn't
do it their defaults suck


Cheers,
Tink
Exactly.

Note: Redhat is no different depending on what you use (ie bash, etc.)
 
Old 12-20-2003, 03:40 PM   #7
cblamer
LQ Newbie
 
Registered: Dec 2003
Posts: 27

Original Poster
Rep: Reputation: 15
pretty sure i used bash in redhat, i dont recall ever seeing a \ in a filename with a space. but doesnt really matter as long as i know whats going on now that i do see them

i just didnt recal seeing them before. then i setup wine, and i see the directory /c/Program\ Files and i was thinking this dosent look right. i better fins out and make sure what i am doing.

anyways thanks everyone.
chris
 
  


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 Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
change uploaded files from filename.avi to filename.avi.html like www.rapidshare.de latheesan Linux - Newbie 3 06-16-2005 05:33 AM
filename~ djc Suse/Novell 2 02-14-2005 02:52 PM
@ in filename Hamsjael Linux - Software 4 01-27-2005 02:05 PM
filename- and filename~ files? slinky2004 Linux - Newbie 5 10-17-2004 11:32 PM
filename? doodah Linux - General 3 04-29-2001 03:48 PM


All times are GMT -5. The time now is 07:58 AM.

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