1

我正在使用 cygwin 在 Windows 中学习 BASH 脚本。我创建了一个目录 /mystuff/unixstuff。我尝试在 Windows 中搜索这个 unixstuff 目录,但我找不到它。cygwin 在哪里创建文件和文件夹?

4

1 回答 1

5

Cygwin's root (/) directory is wherever you tell setup.exe to put it when you first install Cygwin.

I think the default is C:\cgywin. I've also used D:\cygwin.

You can use the cygpath command from the Cygwin bash shell to tell you. I'm not on my Cygwin system at the moment, but I think cygpath -w / will show you the Windows path of the Cygwin root, and cygpath -w /mystuff/unixstuff should tell you the Windows path to your /mystuff/unixstuff directory.

BTW, the usual convention for Unix-like systems (including Cygwin) is to put your own files under your home directory. Putting things directly under the root, as you've done with your /mystuff directory, risks interfering with system files. (Your home directory is probably /home/username, or in Windows something like C:\cygwin\home\username.)

于 2013-07-23T00:56:40.393 回答