The cygpath to enlightenment

If you have a Windows path name and want to go to that path in a Cygwin bash shell, here’s how to do it:

$ cd "`cygpath 'C:\Documents and Settings\Marc'`"

Since this may be hard to remember, here’s a handy bash function:

cdw () 
{ 
    cd "`cygpath "$1"`"
}

Note that you still have to enclose the argument in single quotes so that the shell doesn’t mangle it: e.g.:

$ cdw 'C:\Documents and Settings\Marc'

Leave a Reply

Your email address will not be published. Required fields are marked *