PDA

View Full Version : How to browse directories in UNIX




GigaWire
Oct 14, 2003, 03:28 PM
Well not really that, but how do you open a directory in terminal that has a space in it. for example Desktop DB?

% cd Desktop DB
cd: Too many arguments.
%


Thanks



Rower_CPU
Oct 14, 2003, 03:39 PM
There are two ways:

cd "Desktop DB"

or

cd Desktop\ DB

beerguy
Oct 14, 2003, 03:43 PM
or cd Desktop?DB
or cd Desktop*
...

There is almost always more then one way to do things with Unix; that's part of the power.

3-22
Oct 14, 2003, 03:49 PM
Originally posted by GigaWire
Well not really that, but how do you open a directory in terminal that has a space in it. for example Desktop DB?

% cd Desktop DB
cd: Too many arguments.
%


Thanks

You could also type...

cd Des{tab}

Tab will complete the name... (or attempt to atleast)

Chealion
Oct 14, 2003, 04:01 PM
The reason you got the error for too many arguments is that UNIX will not take spaces in a file name unless preceded by a backslash since the space is used as the seperator between arguments for a command.

Simple Version: No can do spaces, put a backslash in front of any spaces or use tab to make life easier. (Auto-Complete)

GigaWire
Oct 14, 2003, 05:04 PM
Thanks everyone for the replies.