首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Putty不启动.bashrc

Putty不启动.bashrc
EN

Ask Ubuntu用户
提问于 2020-12-08 13:06:20
回答 1查看 698关注 0票数 0

当我远程连接到我的Ubuntu系统时,.bashrc并没有被加载。我之所以知道这一点,是因为.bashrc末尾的行根本不运行,不过如果我在登录. .bashrc后手动点源,它们就不会运行。我查看了/etc/skel并检查了.profile等,还在用户/home/myuser/.profile中看到了用于.bashrc的加载程序行。下面是/home/myuser/.profile中的行(我正在使用myuser从远程Putty.exe主机登录到系统中)。为什么.bashrc不像我从Putty登录到系统时那样加载,/home/myuser/.profile应该加载正确吗?

代码语言:javascript
复制
# if running bash
if [ -n "$BASH_VERSION" ]; then
    # include .bashrc if it exists
    if [ -f "$HOME/.bashrc" ]; then
        . "$HOME/.bashrc"
    fi
fi
EN

回答 1

Ask Ubuntu用户

发布于 2022-07-29 08:53:28

Ubuntu不运行.bashrc。对于Ubuntu,gnome-terminal通常不作为登录壳运行,因此.bashrc应该直接运行。

对于登录shell(如虚拟终端),通常运行文件~/.profile,除非您有~/.bash_profile~/.bash_login,但默认情况下它们不在那里。默认情况下,Ubuntu只使用.profile

票数 -1
EN
页面原文内容由Ask Ubuntu提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://askubuntu.com/questions/1298476

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档