美文网首页
Linux的.bash_profile文件说明

Linux的.bash_profile文件说明

作者: 重识 | 来源:发表于2021-06-11 17:51 被阅读0次

    一、简述

    .bash_profile 一般是用户的配置文件,配置一些基础环境变量

    比如/root/.bash_profile这个文件就是当root用户 用bash作为登陆shell的时候登陆后会运行这个文件里面的一系列的命令。

    用户登录 shell、sh、bash系统会执行此文件,另外当我们使用一个功能其中部分功能是读取bash_profile文件的配置

    二、使用

    1、open ~/.bash_profile  添加配置

    添加我们的一些配置Android和flutter的需要的的url和path

    比如:

    export PUB_HOSTED_URL=https://pub.flutter-io.cn

    export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn

    export PATH=/Users/zhangxiaomeng02/Desktop/flutter-1.22.5/bin:$PATH

    export ANDROID_HOME="/Users/xxx/Library/Android/sdk"

    export PATH=${PATH}:${ANDROID_HOME}/tools

    export PATH=${PATH}:${ANDROID_HOME}/platform-tools

    2、执行我们的环境变量

    source ~/.bash_profile

    运行 source $home/.bash_profile 刷新当前终端窗口.

    相关文章

      网友评论

          本文标题:Linux的.bash_profile文件说明

          本文链接:https://www.haomeiwen.com/subject/oyyveltx.html