I\'m attempting to get into the directory /cygdrive/c/Users/my dir/Documents
:
$ DOCS=\"/cygdrive/c/Users/my\\ dir/Documents\"
$ echo $DOCS
/cyg
Cygwin has issue recognizing space in between the PC name. So to solve this, you have to use "\" after the first word then include the space, then the last name.
such as ".../my\ dir/"
$ cd /cygdrive/c/Users/my\ dir/Documents
Another interesting and simple way to do it, is to put the directory in quotation marks ("")
e.g run it as follows:
$ cd c:
$ cd Users
$ cd "my dir"
$ cd Documents
Hope it works?
As an alternative to using quotes, for a directory you want to go to often, you could use the cdable_vars shell option:
shopt -s cdable_vars
docs='/cygdrive/c/Users/my dir/Documents'
Now, to change into that directory from anywhere, you can use
cd docs
and the shell will indicate which directory it changed to:
$ cd docs
/cygdrive/c/Users/my dir/Documents