SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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.)
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.)
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.