首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 其他教程 > 操作系统 >

ubuntu停环境变量的设置

2013-03-26 
ubuntu下环境变量的设置在 10.10下.bashrc下有如下的代码# Alias definitions.# You may want to put all

ubuntu下环境变量的设置

在 10.10下.bashrc下有如下的代码

# Alias definitions.

# You may want to put all your additions into a separate file like

# ~/.bash_aliases, instead of adding them here directly.

# See /usr/share/doc/bash-doc/examples in the bash-doc package.

?

if [ -f ~/.bash_aliases ]; then

?? ?. ~/.bash_aliases

fi


?说明人家是希望你 用自己alias来设置新增的环境变量。??.bash_profile ?是没有的。

环境变量配置文件

在Ubuntu中有如下几个文件可以设置环境变量
1、/etc/profile:在登录时,操作系统定制用户环境时使用的第一个文件,此文件为系统的每个用户设置环境信息,当用户第一次登录时,该文件被执行。
2、/etc/environment:在登录时操作系统使用的第二个文件,系统在读取你自己的profile前,设置环境文件的环境变量。
3、~/.bash_profile 或者~/.profile:在登录时用到的第三个文件是.profile文件,每个用户都可使用该文件输入专用于自己使用的shell信息,当用户登录时,该 文件仅仅执行一次!默认情况下,他设置一些环境变游戏量,执行用户的.bashrc文件。/etc/bashrc:为每一个运行bash shell的用户执行此文件.当bash shell被打开时,该文件被读取.(在.profile如下注释# ~/.profile: executed by the command interpreter for login shells.

# This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login

# exists.)
4、~/.bashrc:该文件包含专用于你的bash shell的bash信息,当登录时以及每次打开新的shell时,该该文件被读取。




热点排行