Cygwin home location

I've been using cygwin for longer than I care to mention. Never had a problem with it really as it suits me to use it for certain things that Windows truly sucks at.

However, there are a number of issues and I've tried trawling through the cygwin mailing lists which is a laborious task due to their poor web interface design.

I've reinstalled Cygwin as the 64bit version now, which aside from anything has meant that the x86 installed version is not longer needed. Deleting cygwin is reasonably easy except for the dev folder which contain nul which you can't delete. So how can I delete this?

Also as a result of the upgrade, the installation is using C:\Users\myaccountame\ for its home which means when I log in I get:


This is not what I want or what used to be there. In older versions it used to create a home folder in the cygwin folder structure and then make that the home. Now all the bash history is in my Windows folder and the bashrc is also there.

How can I get Cygwin to set the home folder back where it used to be?
LVL 25
Lee SavidgeAsked:
Who is Participating?
Lee SavidgeConnect With a Mentor Author Commented:
Removed the HOME envirnonment variable in Windows. Recreated the launch shortcut after deleting my custom one and things started working again.

Help came from the cygwin mailing list in the end.
for the directory issues try:

putting "cd (your directory path)" in the last line of your .bash_profile (or .profile)
Lee SavidgeAuthor Commented:
I don't want to change the directory in the bashrc, I want the home directory moved back to where cygwin used to have it inside c:\cygwin\home\myaccountname
Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

Try rerunning setup.exe with the -R argument (it specifies the root directory) it is supposed to update as well as install the program.
Lee SavidgeAuthor Commented:

Thanks. The root directory is already c:\cygwin64 and that is where it installs to. That is fine. That is where I want it. Once installed cygwin USED to have a folder called home in its root directory and in there was the folder where bash ran from.

Now, instead of that, when I run cygwin it is using my folder in the Users folder in Windows as the home directory.

It seems to be picking $HOME up from the environment variables which points to %USERPROFILE% in Windows which is:


I could change $HOME in Windows to point to C:\Cygwin64\home\myaccountname but Windows has this environment variable set. Cygwin also seems to be using %USERPROFILE% as it's home and I don't want this. I want it back as it used to be so that when I'm in cygwin and I type cd ~ I end up in my home directory which as far as Windows is concerned C:\cygwin64\home\myaccountname
Lee SavidgeAuthor Commented:
Went to the cygwin mailing list for help in the end. After a few attempts at different things, I got the answer.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.