Linux - Newbie This forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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 .
Tags used in this thread
Popular LQ Tags
name , dir , in
04-17-2009, 01:28 PM
#1
LQ Newbie
Registered: Mar 2009
Posts: 8
Thanked: 0
Hidden backslash in dir name
[
Log in to
get rid of this advertisement]
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.
04-17-2009, 01:43 PM
#2
Senior Member
Registered: Jan 2004
Location: NJ, USA
Distribution: Slackware, Debian
Posts: 4,217
Thanked: 80
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.
04-17-2009, 01:47 PM
#3
Senior Member
Registered: Nov 2006
Location: California
Distribution: Fedora 11, CentOS 5.3, Linux Mint 5, Solaris 10
Posts: 1,260
Thanked: 35
Quote:
Originally Posted by
bobby953
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...
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
04-17-2009, 01:53 PM
#4
LQ Newbie
Registered: Mar 2009
Posts: 8
Thanked: 0
Original Poster
Thanks tons for such a prompt answer.
04-17-2009, 02:02 PM
#5
Moderator
Registered: Nov 2005
Location: Pasadena, CA
Distribution: Arch
Posts: 13,130
Thanked: 281
Quote:
Originally Posted by
custangro
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.....
)
04-17-2009, 02:23 PM
#6
Moderator
Registered: May 2001
Posts: 16,716
Thanked: 283
Ah, and you forgot that 640K ought to be enough for anybody.
04-17-2009, 02:55 PM
#7
Moderator
Registered: Nov 2005
Location: Pasadena, CA
Distribution: Arch
Posts: 13,130
Thanked: 281
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.....
04-17-2009, 03:01 PM
#8
Guru
Registered: Oct 2005
Location: Willoughby, Ohio
Distribution: Debian Lenny / Squeeze / Sid
Posts: 7,213
Thanked: 246
Quote:
Originally Posted by
custangro
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
04-18-2009, 01:37 AM
#9
Member
Registered: Oct 2007
Posts: 302
Thanked: 31
Quote:
Originally Posted by
pixellany
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)
04-18-2009, 12:46 PM
#10
Senior Member
Registered: Nov 2006
Location: California
Distribution: Fedora 11, CentOS 5.3, Linux Mint 5, Solaris 10
Posts: 1,260
Thanked: 35
Quote:
Originally Posted by
farslayer
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
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
All times are GMT -5. The time now is 06:15 AM .
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know .
Latest Threads
LQ News
LQ Podcast
LQ Radio