cygpath
Convert between Windows and Cygwin paths
SYNOPSIS
cygpath [options] pathname...
PARAMETERS
-a, --absolute
Convert to an absolute path. This is the default behavior.
-b, --windows
Output in Windows format. This option overrides all other path-conversion options.
-c, --codepage
Output in the system codepage. The codepage can be specified as argument of this option, or simply assumed from the system defaults if not specified. Supported codepages are 'UTF-8' and 'CPnnn' (where 'nnn' is the number of the codepage).
-d, --dos
Convert to a DOS path (e.g., 'C:\foo\bar').
-f, --file
Read pathnames from the given file, one per line.
-l, --long-mixed
Convert to a long Windows path with mixed forward and backslashes.
-m, --mixed
Convert to a mixed path (e.g., 'c:/foo/bar').
-p, --path
Treat pathnames as a PATH list, separated by colons (Unix) or semicolons (Windows).
-s, --short
Convert to a short DOS path (e.g., 'C:\foo~1').
-t, --type {dos|windows|unix|mixed}
Specify the type of path to convert to.
-u, --unix
Output in Unix format. This is the default.
-w, --winsys
Convert to a Windows system path (e.g. 'C:\windows\system32').
--help
Display help information and exit.
--version
Output version information and exit.
DESCRIPTION
cygpath is a command-line utility provided by Cygwin that facilitates the conversion of file paths between Windows (DOS) format and Unix-like (Cygwin) format.
This is particularly useful when working in a mixed environment where you need to translate paths understood by native Windows applications into paths understood by Cygwin tools, and vice versa. It supports various options to control the output format, including long vs. short Windows paths, mixed case, and the drive letter representation.
cygpath simplifies interoperability between Cygwin and the native Windows environment by providing a reliable way to translate file paths.
CAVEATS
cygpath relies on the Cygwin environment. It will only work as expected within a Cygwin terminal or when the Cygwin DLLs are in the system's PATH. The interpretation of paths depends on the mount points defined within Cygwin.
<B>EXAMPLES</B>
- Convert a Windows path to a Unix path: cygpath 'C:\Program Files'
- Convert a Unix path to a DOS path: cygpath -d '/usr/bin'
- Convert a path to a short DOS path: cygpath -s '/usr/bin'
- Treat a string as a PATH and output in Unix format: cygpath -p 'C:\Windows;C:\Program Files'