chen-lhx

单独查看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 

不报错则成功。 

 

分类:

技术点:

相关文章:

  • 2021-07-08
  • 2021-11-28
  • 2022-02-09
  • 2021-12-15
猜你喜欢
  • 2021-12-15
  • 2021-12-15
相关资源
相似解决方案