how to modify the enviroment varible in Ubuntu

来源:互联网 发布:淘宝多个客服怎么登陆 编辑:程序博客网 时间:2024/06/05 11:32

temporary change will gone after the terminal closed

1. Ctrl+Alt+T

2. export PATH=$PATH:{your path}


user level enviroment varible file location

  • ~/.profile
  • ~/.bash_profile or ~./bash_login
  • ~/.bashrc

not recommand to use for the version prior to Ubuntu 10.0

system level enviroment varible file location


  • /etc/environment
  • /etc/profile
  • /etc/bash.bashrc

/etc/profile and /etc/bash.bashrc   not recommend to use fro the version prior to Ubuntu 10.0


open file:

$ sudo nano /etc/profile

append statement:

export PATH="$PATH:/my_new_path"

make it effective immedicately without login again

$source /etc/profile