美文网首页
关于.bash_profile

关于.bash_profile

作者: XLsn0w | 来源:发表于2020-10-21 13:33 被阅读0次

    1. 启动终端Terminal

    2. 进入当前用户的home目录

        输入cd ~

    3. 创建.bash_profile

        输入touch .bash_profile

    4. 编辑.bash_profile文件

        输入open .bash_profile

      第一种方式

    <1>、为在弹出的.bash_profile文件内进行编辑  

    <2>、编辑完成后直接保存文件

    <3>、关闭.bash_profile文件

    <4>、更新配置过的环境变量    输入source .bash_profile

    在.bash_profile文件为锁定状态的时候,第一种方式是不可行的,

    那么用第二种方式来编辑.bash_profile文件

     第二种方式,在Terminal终端通过指令来对.bash_profile文件进行编辑

    <1>、输入 vim .bash_profile

    <2>、输入 i 进行编辑模式

    <3>、然后把需要编辑的内容键入,编辑完之后直接按esc退出编辑模式,

    <4>、输入 :w 进行文件的保存        输入 :wq 为保存并退出指令

    环境变量

    export BASH_SILENCE_DEPRECATION_WARNING=1

    export PATH=/usr/local/bin:$PATH

    export THEOS=/opt/theos

    export PATH=/opt/theos/bin/:$PATH

    常规创建方式

    1、创建 .bash_profile

    (1) 启动终端

    (2)  cd ~  

    (3)输入touch .bash_profile

    2、查看 、编辑 .bash_profile 文件

    (1)终端输入 open -e .bash_profile

      (如果只是查看,直接使用open .bash_profile)

    (2)编辑

    (3)关闭即可保存修改

    3、更新刚配置的环境变量

    输入source .bash_profile

    相关文章

      网友评论

          本文标题:关于.bash_profile

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