Can I get (the new) bash on Windows 10 to load .profile

dhr_p picture dhr_p · Jun 18, 2016 · Viewed 11.9k times · Source

I installed the new subsystem for Linux on Windows 10 (which comes with the Windows anniversary update), and started playing around with it.

What I noticed is that starting the shell (ubuntu bash) does not load .profile or .bash_profile, even though the .profile file exists. Is there a fix?

(And can someone with a lot of reputation make the windows-bash tag?)

Answer

luk3yx picture luk3yx · Jun 18, 2016

By default, this release of Ubuntu-on-windows loads the file named .bashrc.

You can either put the script or add the below line to .bashrc (and create .bashrc if it is non-existent):

. ~/.profile

Note: If .bashrc is sourced from .profile, you may want to comment it out to prevent bash endlessly looping.