How to get the Windows path to Cygwin home directory?

Cygwin

Cygwin Problem Overview


How can I programmatically determine the current Cygwin user's home directory in Windows format (e.g. C:\cygwin\home\user) so I can read from it outside of Cygwin Bash?

Cygwin Solutions


Solution 1 - Cygwin

You can use cygpath:

cygpath -w ~

Example output:

C:\Users\dhaley
Categories

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionbbodenmillerView Question on Stackoverflow
Solution 1 - CygwinDaniel HaleyView Answer on Stackoverflow