22

我在 Windows 10 上安装了新的 Linux 子系统(随 Windows 周年更新一起提供),并开始使用它。

我注意到的是,即使 .profile 文件存在,启动 shell(ubuntu bash)也不会加载 .profile 或 .bash_profile。有解决办法吗?

(并且有很多声誉的人可以制作 windows-bash 标签吗?)

4

1 回答 1

27

默认情况下,此版本的 Ubuntu-on-windows 加载名为.bashrc.

您可以将脚本或以下行添加到.bashrc.bashrc如果它不存在则创建):

. ~/.profile

注意:如果.bashrc来自.profile,您可能需要将其注释掉以防止 bash 无休止地循环。

于 2016-06-18T21:42:40.980 回答