Directories with spaces in them......PLEASE HELP..

Directories with spaces in them......PLEASE HELP..

Post by Trevo » Tue, 17 Jul 2001 09:09:37



Hi there:

I recently mounted my windows 2000 ntfs partition in linux.  Some of my
directories/folders on this partitions have spaces in them (ex: My
Documents)...   I've tried everything to get into these directories by
using the 'cd' command, but nothing has worked...   I even tried 'cd
My%20Documents", but that doesn't even work...

Can anyone help; me on this....????   Is there a way to denote
ASCII character (ex: ASC(32) for the spacebar or something)....

Thanks in advance...
Trevor...

 
 
 

Directories with spaces in them......PLEASE HELP..

Post by Michael Heimin » Tue, 17 Jul 2001 09:17:24



> Hi there:

> I recently mounted my windows 2000 ntfs partition in linux.  Some of my
> directories/folders on this partitions have spaces in them (ex: My
> Documents)...   I've tried everything to get into these directories by
> using the 'cd' command, but nothing has worked...   I even tried 'cd
> My%20Documents", but that doesn't even work...

> Can anyone help; me on this....????   Is there a way to denote
> ASCII character (ex: ASC(32) for the spacebar or something)....

> Thanks in advance...
> Trevor...

cd My\ Documents

should do the trick.

Michael Heiming

 
 
 

Directories with spaces in them......PLEASE HELP..

Post by Dances With Cro » Tue, 17 Jul 2001 09:20:16


On Sun, 15 Jul 2001 21:39:37 -0230, Trevor staggered into the Black Sun
and said:

Quote:>I recently mounted my windows 2000 ntfs partition in linux.  Some of my
>directories/folders on this partitions have spaces in them (ex: My
>Documents)...   I've tried everything to get into these directories by
>using the 'cd' command, but nothing has worked...   I even tried 'cd
>My%20Documents", but that doesn't even work...

>Can anyone help; me on this....????   Is there a way to denote
>ASCII character (ex: ASC(32) for the spacebar or something)....

From the shell:

cd "My directory with spaces in it"
cd 'My directory with spaces in it'
cd My\ directory\ with\ spaces\ in\ it

That "%20" thing is URLencoding, which is *NOT* used internally, since
Unix shells had to deal with files and directories with spaces in the
names long before the Net as such existed.  Konqueror uses this encoding
in the location bar, but translates it to spaces and puts the whole
thing in quotes, or escapes the spaces using the \ .

Typically, the \ is used to say "The next character is usually a special
character, but now I want to use its literal character code."  Thus we
can have a file named

"'{).txt

and get to it by typing

emacs \"\'\{\).txt

from the shell.

Better yet, use C-style naming conventions for all the files you have
control over.  The only characters you use should be 0-9A-Za-z_-.  Makes
it much easier when working in a cross-platform environment, since in
MacOS < X, "/" is legal in filenames and ":" isn't, in Windows, "\",
"/", "{}", and a few others are not legal, and in Unix, "/" is not legal

--
Matt G|There is no Darkness in Eternity/But only Light too dim for us to see
Brainbench MVP for Linux Admin /     That which does not kill us
http://www.brainbench.com     /      makes us stranger.
-----------------------------/       --Trevor Goodchild, "AEon Flux"

 
 
 

Directories with spaces in them......PLEASE HELP..

Post by Carl Fi » Tue, 17 Jul 2001 10:50:51


Everyone else gave valid answers.  One trick is to use shell completion.  To
cd to "My Documents" I would type

        cd My

and hit the Tab key, which would fill everything out so it looked like:

        cd My\ Documents

which would work.
--

Manager, Dueling Modems Computer Forum
<http://dm.net>

 
 
 

Directories with spaces in them......PLEASE HELP..

Post by Aniarti » Tue, 17 Jul 2001 09:27:04



> Hi there:

> I recently mounted my windows 2000 ntfs partition in linux.  Some of my
> directories/folders on this partitions have spaces in them (ex: My
> Documents)...   I've tried everything to get into these directories by
> using the 'cd' command, but nothing has worked...   I even tried 'cd
> My%20Documents", but that doesn't even work...

> Can anyone help; me on this....????   Is there a way to denote
> ASCII character (ex: ASC(32) for the spacebar or something)....

> Thanks in advance...
> Trevor...

cd "My Documents"
cd My\ Documents

Ani

--
replace spam-me with linux to get an email response
--
Disclamer:
I reserve the right to be 100% wrong/have malformed &/or biased opinions,
feel free to politely correct me. If however you do not wish to be
courteous go {the remainder of this disclamer has been censored}!

 
 
 

Directories with spaces in them......PLEASE HELP..

Post by Jos Bui » Tue, 17 Jul 2001 22:11:32




> > Hi there:

> > I recently mounted my windows 2000 ntfs partition in linux.  Some of my
> > directories/folders on this partitions have spaces in them (ex: My
> > Documents)...   I've tried everything to get into these directories by
> > using the 'cd' command, but nothing has worked...   I even tried 'cd
> > My%20Documents", but that doesn't even work...

> > Can anyone help; me on this....????   Is there a way to denote
> > ASCII character (ex: ASC(32) for the spacebar or something)....

> > Thanks in advance...
> > Trevor...

> cd My\ Documents

> should do the trick.

> Michael Heiming

Or

cd "A directory with spaces"

In other words use " "

Jos

 
 
 

Directories with spaces in them......PLEASE HELP..

Post by Stephen Anthon » Tue, 17 Jul 2001 16:47:40



> Hi there:

> I recently mounted my windows 2000 ntfs partition in linux.  Some of my
> directories/folders on this partitions have spaces in them (ex: My
> Documents)...   I've tried everything to get into these directories by
> using the 'cd' command, but nothing has worked...   I even tried 'cd
> My%20Documents", but that doesn't even work...

> Can anyone help; me on this....????   Is there a way to denote
> ASCII character (ex: ASC(32) for the spacebar or something)....

> Thanks in advance...
> Trevor...

Try enclosing the filename with quote signs.  For example, if you want to
copy a file called 'foo bar', type: cp "foo bar" (whereever).

Steve

 
 
 

Directories with spaces in them......PLEASE HELP..

Post by Chris Brag » Wed, 18 Jul 2001 03:49:05



> Hi there:

> I recently mounted my windows 2000 ntfs partition in linux.  Some of my
> directories/folders on this partitions have spaces in them (ex: My
> Documents)...   I've tried everything to get into these directories by
> using the 'cd' command, but nothing has worked...   I even tried 'cd
> My%20Documents", but that doesn't even work...

> Can anyone help; me on this....????   Is there a way to denote
> ASCII character (ex: ASC(32) for the spacebar or something)....

> Thanks in advance...
> Trevor...

The way I overcame this problem was to do something like this:

cd My?Documents

This way the ? will match any character (including the space) between the
words in Windows.

Hope it helps.

--
Chris Bragg
OS: SuSE Linux 7.2

 
 
 

1. Help Please! Need help with password protecting directories

I am trying to set up a password protected directory...  

I have set up a .htaccess file in the directory which contains:

AuthUserFile /usr/sitename/www/dirname/.htpasswdAuthGroupFile
/dev/null
AuthName ByPasswordAuthType Basic

where sitename and dirname are obviously replaced with appropriate
names.....

I run htpasswd and create a .htpasswd file, but when I try to load an
html file from this directory, i get it without being asked for a
password...

What am I missing?

Jim

2. DOS Merge Question (Ray of Hope actually)

3. List of plug-ins for linux/netscape please!

4. Cron Job problems

5. !HELP! how to change into directory with space?

6. LyX-0.12.0 released

7. Resolving Spaces in Directory Names using regular expressions -- Help!

8. linux 99patch9 + tcpip bugs

9. !HELP! how to change into directory with spaces?

10. PLEASE PLEASE HELP Major problem with my SCSI & Redhat 5.0 PLEASE Help

11. Sendmail problems. Please please please please help!

12. NFS please help me please please please sniff

13. Partiionning problem / Space lost?? HELP Please!