[nflug] cd Program Files

Josh Johnson joshj at linuxmail.org
Wed Nov 16 11:18:28 EST 2005


On Wed, 16 Nov 2005, Cyber Source wrote:

> Eric Benoit wrote:
>
>>  Does anyone know if it is possible to cd into a directory that has spaces
>>  in it?
>>  _______________________________________________
>>  nflug mailing list
>>  nflug at nflug.org
>>  http://www.nflug.org/mailman/listinfo/nflug
>> 
> You could also put quotes around it like "cd folder with space", also, if you 
> hit tab while cd(ing) to finish the name, it will put back slashes in place 
> of the spaces. The quote thing is necessary sometimes if your scp(ing) with 
> spaces. I don't know the exact trigger to the problem, can't remember but the 
> quotes allow spaces in more functions than the back slashes.

It has to do with how the bash (and other) shells interpret. Commands and 
arguments are separated by spaces. Other things can give problems. If you 
have a file called "bad$file" you'd have to do
 	ls bad\$file
 		or
 	ls 'bad$file'
 	ls "bad$file" won't work
also a file like "-badfile" can be tough to remove (or create) if you 
don't know the 
trick. (I did a LOT of manpage reading the first time I came across this)

> _______________________________________________
> nflug mailing list
> nflug at nflug.org
> http://www.nflug.org/mailman/listinfo/nflug
>
_______________________________________________
nflug mailing list
nflug at nflug.org
http://www.nflug.org/mailman/listinfo/nflug



More information about the nflug mailing list