1.Just valid for current user(invalid for root user):
type:
light32@zangchao::~$ sudo gedit ~/.bashrc
[sudo] password for light32:
add:
export PATH=/opt/ur_folder_path:$PATH
(e.g. export PATH=/opt/EmbedSky/4.3.3/bin:$PATH)
make it work right now:
by
light32@zangchao:~$ source ~/.bashrc
or
reset ur computer!
2. Valid for both root user and other users:
type:
light32@zangchao:~$ sudo gedit /etc/environment
[sudo] password for light32:
add :
" :ur_envionment_variables_path " in the end of PATH="....“ .
make it work right now:
by
light32@zangchao:~$ source /etc/environment
or
reset ur computer!
3. An example:
root@chaozang:~# vim /etc/environment
display as follows:
#PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/arm/4.3.2/bin"
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/work/tools/gcc-3.4.5-glibc-2.3.6/bin"
~
~
~
"/etc/environment" 2L, 222C 1,1 All
-------------------------------------------------------------------------------------------
Contact: zangchao.cn@gmail.com