简体   繁体   English

SUSE Linux中的bash_profile在哪里

[英]Where is the bash_profile in SUSE Linux

I could not find the my bash profile which running automatically after login. 我找不到登录后自动运行的bash配置文件。

I already checked /home/(username) with ls -a. 我已经用ls -a检查了/ home /(用户名)。

I am sure there is bash profile because when i echo $somethings, it response. 我确定有bash配置文件,因为当我回显$ somethings时,它会响应。

Could you help me ? 你可以帮帮我吗 ?

After /etc/profile , the bash shell (assuming it's either an interactive login shell or run with the --login option) looks for the first file in this set (in your home directory) that exists and is readable: /etc/profilebash shell(假设它是交互式登录shell或使用--login选项运行)在该集中(在您的主目录中)查找存在且可读的第一个文件:

  • ~/.bash_profile ; ~/.bash_profile ;
  • ~/.bash_login ; ~/.bash_login ; and
  • ~/.profile . ~/.profile

Hence you may not even have a .bash_profile . 因此,你甚至可能不会一个.bash_profile

The rules are actually very complex, depending on the type of the shell and the various arguments you give to it. 规则实际上非常复杂,具体取决于外壳的类型和您为其赋予的各种参数。 If you want to know in detail, have a look in the INVOCATION section of the bash man page. 如果您想详细了解,请查看bash man页的INVOCATION部分。

Check for ~/.bash_profile , ~/.bash_login , ~/.profile or even maybe ~/.bashrc , which isn't a "profile", but might be run after login (see INVOCATION in man bash to understand when and in what order bash reads its startup files). 检查~/.bash_profile~/.bash_login~/.profile或什~/.bashrc ,这不是“配置文件”,但可能在登录后运行(请参阅man bash INVOCATION以了解何时以及在bash以什么顺序读取其启动文件)。 If the file doesn't exist, you can create it. 如果文件不存在,则可以创建它。

There're also the system-wide /etc/profile and /etc/bash.bashrc . 还有系统级的/etc/profile/etc/bash.bashrc

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM