cygpath

From RaySoft

Convert Unix and Windows format paths, or output system path information.[1]

Syntax

cygpath [Parameter ...] NAME [NAME ...]

Documentation

  • man 1 'cygpath'

Parameters

-l, --long-name
Print Windows long form of NAMEs.
-s, --short-name
Print DOS short form of NAMEs.
-u, --unix
Print UNIX form of NAMEs e.g. /cygdrive/c/winnt.
-w, --windows
Print Windows form of NAMEs e.g. C:\WINNT.

Examples

Transform UNIX to Windows path
cygpath --windows "${HOME}"

Output:

C:\Cygwin\home\alex
Transform Windows to UNIX path
cygpath --unix 'C:\Cygwin\home\alex'

Output:

/home/alex

References

  1. man 1 'cygpath'