UNIX-like Interface

3. Filesystem and Path Tips
Filesystem : mount map
 
The "df.exe" utility shows the typical correspondence map (mount points) of Win2K directories into Unix ones:

$ df.exe
Filesystem           1k-blocks      Used Available Use% Mounted on
C:\cygwin\bin         31246392   9010344  22236048  29% /usr/bin
C:\cygwin\lib         31246392   9010344  22236048  29% /usr/lib
C:\cygwin             31246392   9010344  22236048  29% /
c:                    31246392   9010344  22236048  29% /cygdrive/c
h:                   853106684 818677360  34429324  96% /cygdrive/h
w:                     8908008   8109540    798468  92% /cygdrive/w
z:                    26643768   9502432  17141336  36% /cygdrive/z

Important: The Unix environment can be initiated in two different modes
  • bash.exe - will not change the existing PATH
  • bash.exe --login - will prep-append to the existing PATH important Unix directories:
             PATH=/usr/local/bin:/usr/bin:/bin:$PATH
    
  • default current directory "." is not included explicitly in the $PATH


Paths Tips

There are a number of important differences between UNIX paths associated with cygwin and Windows 2000 paths.

  • Unix paths begin with a "/" and are followed by a directory name, which usually does not contain any blank space. Windows 2000 paths start with a drive letter and then the directory, where the directory begins with "\". So home directories might look something like the following:
    UNIX: /u/user23/login_id
    Windows 2000: H:\Users\login_id

  • Changing to a directory with a space, presuming you are already on the H: drive
    UNIX: cd "CTC Tools" or cd CTC\ Tools
    Windows 2000: cd CTC Tools

  • On the H: drive, dir /x shows that the DOS type name of CTC Tools is CTCTOO~1. To change directory using this name the syntax is the same.
    UNIX: cd CTCTOO~1
    Windows 2000: cd CTCTOO~1

  • Using the set command. Suppose we want to associate DXX with H:\Users. The set command in Windows 2000 creates global settings. In this sense it should be viewed as akin to the Unix commands setenv(csh) and export(ksh). In cygwin use setenv under tcsh or set followed by export under bash or ksh.
    UNIX: set DXX=/cygdrive/h/Users or set DXX=H:\\Users or set DXX=H:/Users
    Windows 2000: set DXX=H:\Users