Location of .bashrc for “Bash on Ubuntu on Windows” in Windows 10

点点圈 提交于 2019-11-27 01:17:40

问题


Microsoft just introduced a Linux subsystem in its Windows 10 Anniversary Edition. The installation is pretty straight forward, but I could not locate bash files on Windows.

How does it work? What does ~ refer to in Windows? Where to find .bashrc?


回答1:


Sorry for the misunderstanding, I check on google and it will be at C:\Users\USERNAME\AppData\Local\Lxss\home\USERNAME .

I tried and it works, in the cmd just type cd\ && dir *bashrc* /s it will locate the file, and in my case i see the line C:\Users\USERNAME\AppData\Local\Lxss\home\USERNAME but when I want to navigate it with the window browser it doesn't work, but if you copy paste it, it works :-)

I find it there : http://www.howtogeek.com/261383/how-to-access-your-ubuntu-bash-files-in-windows-and-your-windows-system-drive-in-bash/


Considering that you need to know where a file is located you can use the find command.
The syntax of the command is find {search-path} {file-names-to-search} {action-to-take}by default the action to take is printing the file name.
So if you are finding .bashrc file you can use find / -name .bashrc the bash will return you /home/yourusername/.bashrc

Also, if you want to access to your home directory you can use cd ~
Hope my answer will be helpful :-)




回答2:


Since the Windows 10 Fall Creators Update, the location changed to:

C:\Users\USERNAME\AppData\Local\Packages\{DIST}\LocalState\rootfs\home\{LINUXUSER}\

Where:

  • {DIST} is equal to CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc
  • {LINUXUSER} is the user for which you are looking for the .bashrc file

Just for anyone wondering that came here from Google.




回答3:


~ means that is user home folder, way like /home/%username%/

you can list files like ls -al and see .bashrc file.



来源:https://stackoverflow.com/questions/40820822/location-of-bashrc-for-bash-on-ubuntu-on-windows-in-windows-10

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!