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?
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It only takes a minute to sign up.Sign up to join this community
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
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
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: