[NTLUG:Discuss] fstab entry for a Windoze partition- next stupid question

Steve Baker sjbaker1 at airmail.net
Sat Jun 14 22:33:05 CDT 2003


Wayne Dahl wrote:

> Ok, next stupid question.  When you have a directory like Program Files
> and you're trying to cd to it on the CL, how do you do it?

For names with spaces in, there are several ways to do it:

   cd "Progam Files"

   cd Program\ Files

   cd Program?Files           (Assuming you don't have any similarly named files!)

   cd Prog<ESC>               (Assuming you have auto-complete enabled)

...and for your next class problem - how do you deal with a filename that
starts with a '-' character?

 > ... ls -al just shows it as Program Files, so it doesn't tell me
> what Linux ACTUALLY sees the directory name as.

Linux allows *ANY* sequence of characters (including space, tab, carriage return
and DEL) in a filename - so Linux sees it as it truly is, with an embedded space.

The problem is in the 'shell' (bash or whatever) which assumes that parameters
to a command are separated by spaces - hence it can't tell the difference between
a filename with an embedded space and TWO filenames separated by spaces.

Since embedded spaces are not often used in Linux/UNIX filenames, the assumption
is that this is two filenames.

Escaping the space character, using a wildcard or putting the whole name in quotes
are all work-arounds for that.

---------------------------- Steve Baker -------------------------
HomeEmail: <sjbaker1 at airmail.net>    WorkEmail: <sjbaker at link.com>
HomePage : http://www.sjbaker.org
Projects : http://plib.sf.net    http://tuxaqfh.sf.net
            http://tuxkart.sf.net http://prettypoly.sf.net
-----BEGIN GEEK CODE BLOCK-----
GCS d-- s:+ a+ C++++$ UL+++$ P--- L++++$ E--- W+++ N o+ K? w--- !O M- V-- PS++ PE- Y-- PGP-- t+ 5 X R+++ tv b++ DI++ D G+ e++ h--(-) r+++ y++++
-----END GEEK CODE BLOCK-----




More information about the Discuss mailing list