LinuxQuestions.org

LinuxQuestions.org (http://www.linuxquestions.org/questions/index.php)
-   Linux - Newbie (http://www.linuxquestions.org/questions/forumdisplay.php?f=8)
-   -   Hidden backslash in dir name (http://www.linuxquestions.org/questions/showthread.php?t=719890)

bobby953 04-17-2009 12:28 PM

Hidden backslash in dir name
 
Hi
I copied a music folder from my Win XP to my Linux Server via Samba (Drag and Drop in Windows through Network Neighborhood).

Now, on my server, when I do a ls, the dir name appears as such
ENYA - 1995 - The Memory of Trees

But when I want to cd into it, I have to type:
cd ENYA\ -\ 1995\ -\ The\ Memory\ of\ Trees

Otherwise, I can't change into the dir. Why are these '\' hidden in the directory name
I'm curious. Please let me know. Thanks all in advance.

MS3FGX 04-17-2009 12:43 PM

That is how file names with spaces are handled under Linux, it is normal. If you don't want to type the slashes, put the whole thing in quotes like:

Code:

cd "ENYA - 1995 - The Memory of Trees"
Your shell should be able to finish the file name properly with Tab completion once you start with the quotation marks.

custangro 04-17-2009 12:47 PM

Quote:

Originally Posted by bobby953 (Post 3512415)
Hi
I copied a music folder from my Win XP to my Linux Server via Samba (Drag and Drop in Windows through Network Neighborhood).

Now, on my server, when I do a ls, the dir name appears as such
ENYA - 1995 - The Memory of Trees

But when I want to cd into it, I have to type:
cd ENYA\ -\ 1995\ -\ The\ Memory\ of\ Trees

Otherwise, I can't change into the dir. Why are these '\' hidden in the directory name
I'm curious. Please let me know. Thanks all in advance.

"\" means escape.

Basically you are telling the shell to "ignore" the spaces...

FYI...

:twocents:

Maybe I'm "old school". But I think that you should never put spaces in file names...

If I absolutely need separation; I use underscore (i.e. ENYA_1995_The_Memory_of_Trees)

But I'm probably alone on this one :P

-C

bobby953 04-17-2009 12:53 PM

Thanks tons for such a prompt answer. :)

pixellany 04-17-2009 01:02 PM

Quote:

Originally Posted by custangro (Post 3512446)
Maybe I'm "old school". But I think that you should never put spaces in file names...

But I'm probably alone on this one

Nope, you are not alone......
Filenames should not have spaces.
People should learn the CLI
And filenames should not have more than 8 characters...
And real men program Fortran with punch cards....

(I guess I'm older school than you.....;))

unSpawn 04-17-2009 01:23 PM

Ah, and you forgot that 640K ought to be enough for anybody.

pixellany 04-17-2009 01:55 PM

Ummmm, 640K is HUGE.....
Apple-II 64K
Mac 128K

Almost forgot: I did a paper in college on magnetic core memory. In those days, you could actually SEE a bit.....;)

farslayer 04-17-2009 02:01 PM

Quote:

Originally Posted by custangro (Post 3512446)
Maybe I'm "old school". But I think that you should never put spaces in file names...

If I absolutely need separation; I use underscore (i.e. ENYA_1995_The_Memory_of_Trees)

But I'm probably alone on this one :P

-C

Definitely not alone on this one.. I even do that on Windows systems out of habit

Valery Reznic 04-18-2009 12:37 AM

Quote:

Originally Posted by pixellany (Post 3512535)
ummmm, 640k is huge.....
Apple-ii 64k
mac 128k

almost forgot: I did a paper in college on magnetic core memory. In those days, you could actually see a bit.....;)

pdp-11 - 64 kb (without memory dispatcher)

custangro 04-18-2009 11:46 AM

Quote:

Originally Posted by farslayer (Post 3512539)
Definitely not alone on this one.. I even do that on Windows systems out of habit

Nice to see that I'm not the only "crazy" one ;)


All times are GMT -5. The time now is 09:12 AM.