zoukankan      html  css  js  c++  java
  • linux下查看和添加path环境变量

    单独查看PATH环境变量,可用: 

    [root@localhost u-boot-sh4 #]echo $PATH 

    /usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin 

    添加PATH环境变量: 

    第一种方法:

    [root@localhost u-boot-sh4 #]export PATH=/opt/STM/STLinux-2.3/devkit/sh4/bin:$PATH 

    再次查看: 

    [root@localhost u-boot-sh4 #] echo $PATH 

    /opt/STM/STLinux-2.3/devkit/sh4/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin

    说明添加PATH成功。 

    上述方法的PATH 在终端关闭 后就会消失。所以还是建议通过编辑~/.bashrc或~/.bash_profile或系统级别的/etc/profil来改PATH,也可以改家目录下的.bashrc(即:~/.bashrc)。 

    第二种方法: 

    # vim /etc/profile 

    在文档最后,添加: 

    export PATH="/opt/STM/STLinux-2.3/devkit/sh4/bin:$PATH" 

    保存,退出,然后运行: 

    #source /etc/profile 

    不报错则成功。 

  • 相关阅读:
    MyBatis的几种批量操作
    mysql event_scheduler运行一段时间后 自动关闭
    Mysql 中的事件//定时任务
    JSON对象
    JSON语法
    JSON简介——(0)
    【zTree】zTree的3.5.26静态树与动态树(实用)
    frameset测试
    iframe测试
    jQuery遍历方式
  • 原文地址:https://www.cnblogs.com/chen-lhx/p/5613359.html
Copyright © 2011-2022 走看看