cygpath命令各參數詳解


復制文章: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可以任意格式輸出關於重要系統目錄位置的信息。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM