Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get the Windows path to Cygwin home directory?

Tags:

cygwin

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?

like image 783
bbodenmiller Avatar asked Mar 16 '17 18:03

bbodenmiller


People also ask

Where is Cygwin home directory in Windows?

Using Cygwin The installation directory (by default, c:\cygwin) is the root of the Unix-like file system, which contains bin, etc, home, tmp, and usr directories as would be found on a GNU/Linux or other Unix system.

How do I get to my home directory in Cygwin?

In a new installation of Cygwin, your home directory will be in C:/cygwin/home/<user>/ , and can be accessed by the usual ~ shortcut. Although this works just fine, it's often useful to use the utilities provided by Cygwin in your local Windows user area C:/Users/<user> .

Where is PATH set in Cygwin?

From the Start menu, select Parameters > Control Panel > System. Select the Advanced tab and click Environment variables. Edit the PATH environment variable to add the Cygwin installation directory, for example c:\cygwin\bin; and click OK.

How do I go to a directory in Cygwin?

In Windows, after you have installed Cygwin, you can launch a Cygwin64 Terminal: Associated with the state of the terminal is a working directory, or in the parlance of Windows, a current directory. Specifically, by default when you open a Cygwin64 Terminal, the working directory is /home/your-user-id.


1 Answers

You can use cygpath:

cygpath -w ~ 

Example output:

C:\Users\dhaley 
like image 113
Daniel Haley Avatar answered Sep 22 '22 02:09

Daniel Haley