Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

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?)

like image 706
dhr_p Avatar asked Jun 18 '16 21:06

dhr_p


People also ask

Does Windows 10 have a Bash shell?

Note that bash runs natively on Windows 10, which is different from using emulators like 'cygwin' for Windows which enabled GNU tools to run on unsupported Windows environment. Also, Linux subsystem for Windows 10 is only available on the 64-bit version of the OS.

How do I get Bash to work on Windows?

Enable the new Bash on Ubuntu on Windows 1 – Right click on the Start icon and select Programs and Features. 2 – Click Turn Windows features on or off. 3 – Scroll down to the new Windows subsystem for Linux and tick it, click OK. 4 – Wait for it to apply and reboot when prompted.

Is there a bash_profile in Windows?

You can put . bash_profile in your user directory: C:\Users\<username>. If aliases for Git commands are needed, editing the .


1 Answers

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.

like image 87
luk3yx Avatar answered Sep 22 '22 21:09

luk3yx