复制文章:https://blog.csdn.net/lxllzl/article/details/86484885
cygpath — Convert Unix and Windows format paths, or output system path information。
下面是命令模板
1 cygpath (-d|-m|-u|-w|-t TYPE) [-f FILE] [OPTION]... NAME... 2 cygpath [-c HANDLE] 3 cygpath [-ADHOPSW] 4 cygpath [-F ID]
OPTION:
1 -d, --dos print DOS (short) form of NAMEs (C:PROGRA~1) 2 -m, --mixed like --windows, but with regular slashes (C:/WINNT) 3 -M, --mode report on mode of file (currently binmode or textmode) 4 -u, --unix (default) print Unix form of NAMEs (/cygdrive/c/winnt) 5 -w, --windows print Windows form of NAMEs (C:WINNT) 6 -t, --type TYPE print TYPE form: 'dos', 'mixed', 'unix', or 'windows' 7 8 Path conversion options: 9 10 -a, --absolute output absolute path 11 -l, --long-name print Windows long form of NAMEs (with -w, -m only) 12 -p, --path NAME is a PATH list (i.e., '/bin:/usr/bin') 13 -U, --proc-cygdrive Emit /proc/cygdrive path instead of cygdrive prefix 14 when converting Windows path to UNIX path. 15 -s, --short-name print DOS (short) form of NAMEs (with -w, -m only) 16 -C, --codepage CP print DOS, Windows, or mixed pathname in Windows 17 codepage CP. CP can be a numeric codepage identifier, 18 or one of the reserved words ANSI, OEM, or UTF8. 19 If this option is missing, cygpath defaults to the 20 character set defined by the current locale. 21 22 System information: 23 24 -A, --allusers use `All Users' instead of current user for -D, -P 25 -D, --desktop output `Desktop' directory and exit 26 -H, --homeroot output `Profiles' directory (home root) and exit 27 -O, --mydocs output `My Documents' directory and exit 28 -P, --smprograms output Start Menu `Programs' directory and exit 29 -S, --sysdir output system directory and exit 30 -W, --windir output `Windows' directory and exit 31 -F, --folder ID output special folder with numeric ID and exit 32 33 Other options: 34 35 -f, --file FILE read FILE for input; use - to read from STDIN 36 -o, --option read options from FILE as well (for use with --file) 37 -c, --close HANDLE close HANDLE (for use in captured process) 38 -i, --ignore ignore missing argument 39 -h, --help output usage information and exit 40 -V, --version output version information and exit
cygpath程序是一个实用程序,它可以将Windows本地文件名转换为Cygwin POSIX样式的路径名,反之亦然。当Cygwin程序需要向本机Windows程序传递文件名,或希望从本机Windows程序获取文件名时,可以使用它。或者,cygpath可以任意格式输出关于重要系统目录位置的信息。