
在 MSYS Bash 中我得到:
$ cd ~
$ pwd
/c/Users/antonio
但:
$ cd /
$ pwd
/
我可以從 Bash 取得完整的 Windows 絕對路徑嗎?
答案1
在最近的版本中,例如系統2, 您可以使用:
~$ cygpath -w /
C:\path\to\root
或使用混合路徑樣式:
~$ cygpath -m /
C:/path/to/root
同樣,您可以使用:
~$ cygpath -w ~
C:\path\to\home
~$ cygpath -m ~
C:/path/to/home