Cygwin convert windows path to linux path: Difference between revisions
Jump to navigation
Jump to search
m (→reference) |
|||
| Line 58: | Line 58: | ||
* [http://cygwin-lite.sourceforge.net/html/cygpath.html Cygwin Utilities: cygpath] | * [http://cygwin-lite.sourceforge.net/html/cygpath.html Cygwin Utilities: cygpath] | ||
* [http://superuser.com/questions/885700/cygwin-convert-windows-path-to-unix-then-change-dir/1068015#1068015 Cygwin convert windows path to unix then change dir - Super User] | * [http://superuser.com/questions/885700/cygwin-convert-windows-path-to-unix-then-change-dir/1068015#1068015 Cygwin convert windows path to unix then change dir - Super User] | ||
* [https://superuser.com/questions/102233/how-to-go-to-remote-directory-in-cygwin windows - How to go to remote directory in Cygwin? - Super User] | |||
[[Category:Software]] [[Category:Windows]] [[Category:Linux]] [[Category:Cygwin]] | [[Category:Software]] [[Category:Windows]] [[Category:Linux]] [[Category:Cygwin]] | ||
Revision as of 15:06, 21 May 2019
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
//method1 $ cd "$(cygpath -u 'c:\Program Files\')" $ pwd /cygdrive/c/Program Files //method2 $ cygpath -u 'c:\Program Files\' /cygdrive/c/Program Files/ copy the above path & paste to the console $ cd /cygdrive/c/Program Files/ $ pwd /cygdrive/c/Program Files
troubleshooting
enclose the whole path with single quote symbols ex: cygpath -u 'c:\Program Files\' if the path contains spaces $ cygpath -u c:\Program Files\ met error, press ctrl+c to escape enclose with double quote symbols 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\