linux命令 export
时间: 2023-09-30 16:06:46 浏览: 214
Linux命令export用于设置或显示环境变量。在shell中执行程序时,shell会提供一组环境变量。export命令可以新增、修改或删除环境变量,供后续执行的程序使用。export命令的效力仅限于该次登录操作。 通过export命令可以设置或显示环境变量的值。语法格式为export [-fnp][变量名称]=[变量设置值]。 使用export命令可以自定义命令行前面的显示,例如显示用户名、主机名和shell名称。可以在.bashrc文件中添加export PS1="\u@\h>\s "来实现,需要通过source ~/.bashrc命令使其立即生效。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [浅析linux环境变量export命令详解](https://download.csdn.net/download/weixin_38640985/14092765)[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^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *2* [Linux命令之export](https://blog.csdn.net/sinat_34241861/article/details/109453057)[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^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *3* [Linux之export命令](https://blog.csdn.net/weixin_37335761/article/details/119879926)[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^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 33.333333333333336%"]
[ .reference_list ]
阅读全文