When trying to access ~/.bash_profile
from Ubuntu Xenial (16.04) in Windows Subsystem for Linux I get the following error:
-bash: /home/<username>/.bash_profile: No such file or directory
Where is it located and how do I edit it?
Thank you!
When trying to access ~/.bash_profile
from Ubuntu Xenial (16.04) in Windows Subsystem for Linux I get the following error:
-bash: /home/<username>/.bash_profile: No such file or directory
Where is it located and how do I edit it?
Thank you!
From the man page for bash:
By default, it first reads and executes commands from the file > /etc/profile, if that file exists. After reading that file, it looks for ~/.bash_profile, ~/.bash_login, and ~/.profile, in that order, and reads and executes commands from the first one that exists and is readable.
So it exists in your home directory IF AND WHEN you create it and make it readable.
With the bash on windows the files are located at in the same location if you are running within the bash environment, ie /home/user_name/.bashrc
.
Create the file , form bash, as suggested by Rinzwind if necessary.
However, if you are looking at the files from windows, outside the bash subsystem, they are located at
C:\Users\<username>\AppData\Local\Lxss\rootfs
so ...
C:\Users\<username>\AppData\Local\Lxss\rootfs\home\username
Note: The windows user name may or may not be the same as your bash username, depends on how you set bash up I suppose.
Warning - Dont edit or modify files in your bash environment from windows, see this link:
.profile
and.bashrc
that are in the home folder in WSL. – Terrance Oct 26 '17 at 18:32.bash_profile
. – Eliah Kagan Oct 27 '17 at 15:19