I\'m attempting to get into the directory /cygdrive/c/Users/my dir/Documents
:
$ DOCS=\"/cygdrive/c/Users/my\\ dir/Documents\"
$ echo $DOCS
/cyg
Why not put the following in your .cshrc
(or .bashrc
, or whatever your default shell is):
alias mydoc 'cd "/cygdrive/c/Users/my dir/Documents"'
First time you do this, you have to do
source .cshrc
to update the shell with this new alias, then you can type
mydoc
anytime you want to cd
to your directory.
Laziness is the mother of invention...
If you want to move from c:\
and you want to go to c:\Documents and settings
, write on console: c:\Documents\[space]+tab
and cygwin will autocomplete it as c:\Documents\ and\ settings/
Instead of:
DOCS="/cygdrive/c/Users/my\ dir/Documents"
Try:
DOCS="/cygdrive/c/Users/my dir/Documents"
This should work on any POSIX system.
ok i spent some frustrating time with this problem too. My little guide.
Open desktop for example. If you didnt switch your disc in cmd, type:
cd desktop
Now if you want to display subfolders:
cd, make 1 spacebar, and press tab 2 times
Now if you want to enter directory/file with SPACE IN NAME. Lets open some file name f.g., to open it we need to type:
cd file\ name
p.s. notice this space after slash :)
try
DOCS="/cygdrive/c/Users/my\ dir/Documents";
cd "$DOCS"
Use the backslash symbol to escape the space
C:\> cd my folder
will be
C:\> cd my\folder