.bashrc在Windows 10中"在Windows上使用Ubuntu进行Bash"的位置

Mee*_*iya 24 linux windows bash .bash-profile windows-subsystem-for-linux

微软刚刚在其Windows 10周年纪念版中引入了一个Linux子系统.安装非常简单,但我找不到Windows上的bash文件.

它是如何工作的?~在Windows 中引用了什么?哪里可以找到.bashrc

ncw*_*ncw 34

自Windows 10 Fall Creators Update以来,位置已更改为

C:\Users\USERNAME\AppData\Local\Packages\{DIST}\LocalState\rootfs\home\{LINUXUSER}\
Run Code Online (Sandbox Code Playgroud)

在哪里{DIST}等于CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc.

只是想知道来自谷歌的人.

  • `C:\Users\USERNAME\AppData\Local\Packages\{DIST}\LocalState\rootfs\home\` 这个文件夹似乎是空的 (2认同)

Bin*_*ump 25

对不起,误解,我检查谷歌,它将在C:\Users\USERNAME\AppData\Local\Lxss\home\USERNAME.

我尝试了它的工作原理,在cmd中输入cd\ && dir *bashrc* /s它会找到文件,在我的情况下我会看到该行,C:\Users\USERNAME\AppData\Local\Lxss\home\USERNAME但是当我想用窗口浏览器导航它时它不起作用,但如果你复制粘贴它,它工程:-)

我在那里找到它:http://www.howtogeek.com/261383/how-to-access-your-ubuntu-bash-files-in-windows-and-your-windows-system-drive-in-bash/


考虑到您需要知道文件的位置,您可以使用该find命令.默认情况下
,该命令的语法find {search-path} {file-names-to-search} {action-to-take}是打印文件名.
因此,如果您正在查找.bashrc文件,您可以使用find / -name .bashrcbash返回给您/home/yourusername/.bashrc

此外,如果你想访问你的主目录,你可以使用cd ~
希望我的答案将有所帮助:-)


Jam*_*s M 7

~ 表示这是用户主文件夹,类似于 /home/%username%/

您可以列出文件,例如ls -al并查看 .bashrc 文件。


Jhi*_*bar 7

只需输入 vi ~/.bashrc

这应该将您放入文件中,无论它在哪里。cd ~ 您只需通过执行“列出所有文件”即可导航到那里ls -a,您应该能够看到它。