在linux里设置永久环境变量的方法(Method for setting permanent environment variables in Linux)
在linux里设置永久环境变量的方法(Method for setting permanent environment variables in Linux)
Method for setting environment variables in Linux
In general, when you configure cross compile tool chains, you need to specify the path of the build tool, which you need to set the environment variable. For example, my mips-linux-gcc compiler, in the /opt/au1200_rm/build_tools/bin directory, build_tools is my compilation tool, and there are three ways to set up environment variables:
1, use the export command directly:
#export PATH=$PATH:/opt/au1200_rm/build_tools/bin
Check to see if it is set up and check with the command export:
[root@localhost bin]# export
Declare -x BASH_ENV= "/root/.bashrc""
Declare -x G_BROKEN_FILENAMES= "1""
Declare -x HISTSIZE= "1000""
Declare -x HOME= "/root""
Declare -x HOSTNAME= "localhost.localdomain""
Declare -x INPUTRC= "/etc/inputrc""
Declare -x LANG= "zh_CN.GB18030""
Declare -x LANGUAGE= "zh_CN.GB18030:zh_CN.GB2312:zh_CN""
Declare -x LESSOPEN= "|/usr/bin/lesspipe.sh%s""
Declare -x LOGNAME= "root""
Declare -x LS_COLORS= no=00:fi=00:di=01 "; 34:ln=01; 36:pi=40; 33:so=01; 35:bd=40; 33; 01:cd=40; 01:or=01; 33; 05; 37; 05; 37; 41:mi=01; 41:ex=01; 32:*.cmd=01; 32:*.exe=01; 32:*.com=01; 32:*.btm=01; 32:*.bat=01; 32:*.sh=01; 32:*.csh= 01; 32:*.tar=01; 31:*.tgz=01; 31:*.arj=01; 31:*.taz=01; 31:*.lzh=01; 31:*.zip=01; 31:*.z=01; 31:*.Z=01; 31:*.gz=01; 31:*.bz2=01; 31:*.bz=01; 31:*.tz=01; 31:*.rpm=01; 31:*.cpio=01; 31:*.jpg=01; 35:*.gif=01; 35:*.bmp=01; 35:*.xbm=01; 35:*.Xpm=01; 35:*.png=01; 35:*.tif=01; 35"
Declare -x MAIL= "/var/spool/mail/root""
Declare -x OLDPWD= "/opt/au1200_rm/build_tools""
Declare -x PATH= "/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/root/bin:/opt/au1200_rm/build_tools/bin""
Declare -x PWD= "/opt/au1200_rm/build_tools/bin""
Declare -x SHELL= "/bin/bash""
Declare -x SHLVL= "1""
Declare -x SSH_ASKPASS= "/usr/libexec/openssh/gnome-ssh-askpass""
Declare -x SSH_AUTH_SOCK= "/tmp/ssh-XX3LKWhz/agent.4242""
Declare -x