linux设置path环境变量
时间: 2023-09-23 09:06:12 浏览: 112
回答: 在Linux中设置PATH环境变量有几种方法。一种是通过修改.bash_profile文件,将需要添加的目录路径添加到PATH变量中,并执行命令source ~/.bash_profile使修改生效。这种方法是临时性的,只在当前会话中有效。另一种是通过修改.bashrc或系统级别的/etc/profile文件,在其中添加export PATH=xxx:$LD_LIBRARY_PATH,并执行命令source .bashrc使修改生效。这种方法是永久性的,对所有用户有效。PATH是一系列目录路径的集合,用于指定系统在执行命令时的查找路径。它的格式为PATH=$PATH:<PATH1>:<PATH2>:<PATH3>:------:<PATHN>,多个路径之间使用冒号进行分隔。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *3* [linux 添加环境变量 PATH](https://blog.csdn.net/hj1993/article/details/81570807)[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: 50%"]
- *2* [linux环境变量设置方法(PATH等环境变量)](https://blog.csdn.net/oqqHuTu12345678/article/details/78959230)[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: 50%"]
[ .reference_list ]
阅读全文