http://blog.csdn.net/duguduchong/article/details/7680650Cygwin accessing the Windows disk directoryTags: Windows disk user Platform C2012-06-20 17:51 5771 People read Comments (1) favorite reports Classification:Windows (one)
Just touching Cygwin, the first question is: How to access the various disk directories of Windows, and how to access directories in Cygwin under the Windows platform.
After you execute the Mount command, you can see that the drive letter under Windows is mapped to the/cygdrive special directory.
- $ mount
- C:/cygwin/bin on/usr/bin type NTFS (BINARY,AUTO)
- C:/cygwin/lib on/usr/lib type NTFS (BINARY,AUTO)
- C:/cygwin on/type NTFS (binary,auto)
- C:ON/CYGDRIVE/C type NTFS (binary,posix=0,user,noumount,auto)
- D:ON/CYGDRIVE/D type NTFS (binary,posix=0,user,noumount,auto)
In other words, the C:\Windows directory under Windows is accessed in Cygwin with path/cygdrive/c/windows. In fact, Cygwin provides the Cygpath command to implement a transformation of the directory name between the Windows platform and Cygwin, as follows:
- $ cygpath-u C:\\Windows
- /cygdrive/c/windows
- $ cygpath-w ~/
- C:\cygwin\home\jiangxin\
As can be seen from the above example, the user home directory under Cygwin (that is,/home/jiangxin/) is equivalent to the C:\cygwin\home\jiangxin\ directory under Windows.
Transfer from http://book.51cto.com/art/201107/278828.htm
Cygwin accessing the Windows disk directory