How to format a Windows path to a Unix path on Cygwin command line How to format a Windows path to a Unix path on Cygwin command line unix unix

How to format a Windows path to a Unix path on Cygwin command line


Thanks all. Apparently all I need are single quotes around the path:

cd 'C:\windows\path'

and Cygwin will convert it. Cygpath would work too, but it also needs the single quotes to prevent the shell from eating the backslash characters.


Read about the cygpath command.

somecommand `cygpath -u WIN_PATH`

e.g.


cmd.exe doesn't like single quotes. You should use double quotes

C:\test>echo C:\windows\path|sed "s|\\|/|g"C:/windows/path