linux 刷新环境变量
时间: 2023-10-12 08:03:08 浏览: 204
linux环境变量
要刷新Linux环境变量,有两种方法可以实现。
方法一:在/etc/profile文件中添加变量
通过编辑/etc/profile文件并添加相应的环境变量,可以使该变量对Linux下所有用户都有效,并且是“永久的”修改。可以使用VI编辑器打开/etc/profile文件,添加你需要的环境变量。然后,为了使修改立即生效,需要执行以下命令:source /etc/profile。这将重新加载/etc/profile文件并更新环境变量。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [linux 刷新环境变量](https://blog.csdn.net/youcijibi/article/details/78559295)[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^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *2* [linux环境下的 刷新环境变量](https://blog.csdn.net/zhang__1234/article/details/126883780)[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^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *3* [Linux常用命令](https://blog.csdn.net/qq_37335810/article/details/97403449)[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^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 33.333333333333336%"]
[ .reference_list ]
阅读全文