启动环境变量.bashrc
时间: 2023-08-19 11:06:24 浏览: 155
启动环境变量.bashrc是通过在登录Linux时执行.bash_profile文件来实现的。在登录Linux时,系统会首先读取~/.bash_profile文件,然后再执行~/.bashrc文件。这样做的好处是可以在登录时设置一些系统级别的环境变量和路径,而在每次打开终端时设置一些用户级别的别名和函数。所以,要启动环境变量.bashrc,可以在.bash_profile文件中显式调用.bashrc。这样,当登录Linux时,.bashrc文件也会被执行,你的个性化设置也就生效了。\[1\]\[2\]另外,你也可以直接编辑~/.bashrc文件,在其中添加需要的环境变量,然后在每次执行脚本时都会加载此文件。记得在修改完后使用source命令使修改生效。\[3\]
#### 引用[.reference_title]
- *1* [linux下.bashrc文件 /PATH环境变量修改 /提示符修改](https://blog.csdn.net/craftsman2020/article/details/111945949)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item]
- *2* [配置开机自启命令文件~/.bashrc、/etc/profile、/etc/bash.bashrc的异同(bashrc:Bash Run Commands)环境...](https://blog.csdn.net/Dontla/article/details/128991142)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item]
- *3* [关于shell脚本环境变量.bashrc配置](https://blog.csdn.net/weixin_44034508/article/details/88351900)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]
阅读全文