linux下查看和添加PATH环境变量
来源:互联网 发布:深入浅出 mac osx 编辑:程序博客网 时间:2024/05/09 14:37
linux下查看和添加PATH环境变量
你可以自己加上指定的路径,中间用冒号隔开。环境变量更改后,在用户下次登陆时生效,如果想立刻生效,则可执行下面的语句:
可用 export 命令查看PATH值
[root@localhost u-boot-sh4]# export
declare -x CVS_RSH=”ssh”
declare -x DISPLAY=”:0.0”
declare -x G_BROKEN_FILENAMES=”1”
declare -x HISTSIZE=”1000”
declare -x HOME=”/root”
declare -x HOSTNAME=”localhost”
declare -x INPUTRC=”/etc/inputrc”
declare -x LANG=”zh_CN.UTF-8”
declare -x LESSOPEN=”|/usr/bin/lesspipe.sh %s”
declare -x LOGNAME=”root”
declare -x LS_COLORS=”no=00:fi=00:di=00;34:ln=00;36:pi=40;33:so=00;35:bd=40;33;01:cd=40;33;01:or=01;05;37;41:mi=01;05;37;41:ex=00;32:.cmd=00;32:.exe=00;32:.com=00;32:.btm=00;32:.bat=00;32:.sh=00;32:.csh=00;32:.tar=00;31:.tgz=00;31:.arj=00;31:.taz=00;31:.lzh=00;31:.zip=00;31:.z=00;31:.Z=00;31:.gz=00;31:.bz2=00;31:.bz=00;31:.tz=00;31:.rpm=00;31:.cpio=00;31:.jpg=00;35:.gif=00;35:.bmp=00;35:.xbm=00;35:.xpm=00;35:.png=00;35:.tif=00;35:”
declare -x MAIL=”/var/spool/mail/root”
declare -x OLDPWD=”/root”
declare -xPATH=”/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin”
declare -x PWD=”/opt/STM/STLinux-2.3/devkit/sources/u-boot/u-boot-sh4”
declare -x SHELL=”/bin/bash”
declare -x SHLVL=”1”
declare -x SSH_ASKPASS=”/usr/libexec/openssh/gnome-ssh-askpass”
declare -x TERM=”xterm”
declare -x USER=”root”
declare -x XAUTHORITY=”/root/.xauthkSzH7b”
单独查看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 在终端关闭 后就会消失。所以还是建议通过编辑/etc/profile来改PATH,也可以改家目录下的.bashrc(即:~/.bashrc)。
第二种方法:
vim /etc/profile
在文档最后,添加:
export PATH=”/opt/STM/STLinux-2.3/devkit/sh4/bin:$PATH”
保存,退出,然后运行:
source /etc/profile
不报错则成功
- linux下查看和添加PATH环境变量
- Linux下查看和添加PATH环境变量
- linux下查看和添加PATH环境变量
- linux下查看和添加PATH环境变量
- linux下查看和添加PATH环境变量
- linux下查看和添加PATH环境变量
- linux下查看和添加PATH环境变量
- linux下查看和添加PATH环境变量
- linux下查看和添加PATH环境变量
- linux下查看和添加PATH环境变量
- linux下查看和添加PATH环境变量
- linux下查看和添加PATH环境变量
- linux下查看和添加PATH环境变量
- linux下查看和添加PATH环境变量
- linux下查看和添加PATH环境变量
- Linux下查看和添加PATH环境变量
- linux下查看和添加PATH环境变量
- Linux下查看和添加PATH环境变量
- [Android] 环境配置之Android Studio开发NDK
- 初学spark streaming
- 实用小工具:像素尺子
- hdu4746 Mophues(莫比乌斯反演)-好题
- 各大平台免费接口
- linux下查看和添加PATH环境变量
- 总结【待续】
- Socket的accept函数解析
- 371. Sum of Two Integers
- MyBatis批量插入和性能问题
- 匈牙利算法 hdu 2063(过山车)
- 浏览器加载和渲染html的顺序
- android之Handler的使用
- centos下的mysql安装