1.ubuntu中与环境变量有关的文件夹有
/etc/profile:通过此文huan环境变量每个用户都可以使用
/etc/bashrc:为每一个运行bash shell的用户执行此文件.当bash shell被打开时,该文件被读取.
~/.bashrc:该文件包含专用于你的bash shell的bash信息,当登录时以及每次打开新的shell时,该文件被读取.
~/.bash_profile:通过此文件设置属于用户的环境变deng登陆时.bashrc被执行
2.设置环境变量
vim+文件名(/etc/profile;/etc/bashrc;~/.bashrc;~/.bash_profile)
格式:export PATH=$PATH:+路径名