Cygwin convert windows path to linux path: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
|||
| Line 29: | Line 29: | ||
met error, press ctrl+c to escape | met error, press ctrl+c to escape | ||
enclose with double quote symbol after cd command ex: cd "$(cygpath -u 'c:\Program Files\')" | enclose with double quote symbol after cd command ex: cd "$(cygpath -u 'c:\Program Files\')" if the path contains spaces | ||
$ cd $(cygpath -u 'c:\Program Files\') | $ cd $(cygpath -u 'c:\Program Files\') | ||
-bash: cd: /cygdrive/c/Program: No such file or directory | -bash: cd: /cygdrive/c/Program: No such file or directory | ||
Revision as of 17:06, 22 April 2016
Using Cygwin Utilities: cygpath to convert windows path ↔ to linux path
steps
- launch cygwin
- input the following commands after $ symbol
convert windows path to linux path
$ cygpath -u 'c:\Users\User\Desktop\' /cygdrive/c/Users/User/Desktop/ enclose the whole path with single quote symbol if the path contains white space characters $ cygpath -u 'c:\Program Files\' /cygdrive/c/Program Files/
switch to the specified path
$ cd "$(cygpath -u 'c:\Program Files\')" $ pwd /cygdrive/c/Program Files
troubleshooting
enclose the whole path with single quote symbol if the path contains white space characters ex: cygpath -u 'c:\Program Files\' $ cygpath -u c:\Program Files\ met error, press ctrl+c to escape enclose with double quote symbol after cd command ex: cd "$(cygpath -u 'c:\Program Files\')" if the path contains spaces $ cd $(cygpath -u 'c:\Program Files\') -bash: cd: /cygdrive/c/Program: No such file or directory $ cd '$(cygpath -u 'c:\Program Files\')' -bash: syntax error near unexpected token `)'
convert linux path to windows path
$ cygpath -w '/cygdrive/c/Program Files/' c:\Program Files\