jiangsu08 于 2008-01-17 21:45:42发表:
~/.bash_login文件没有 但有一个.bash_logout ~/.profile也没有 那么red hat如何配置普通用户环境呢 ?
jiangsu08 于 2008-01-17 21:32:35发表:
谢谢 Nesoikps~~~~
Nesoikps 于 2008-01-17 21:11:40发表:
系统启动后运行的第一个进程是init,它的进程标识符PID是1。init派生出一个getty进程。该进程负责打开终端端口,提供stdin的来源,stdout与stderr的去向。接下来执行的是/bin/login程序。提示用户输入口令,加密并验证用户输入口令,设置初始化环境,启动用户的登陆shell,即bash。 bash有很多的启动文件,这些文件是可以执行source命令。登陆shell时,先对系统初始化文件/etc/profile执行source命令。接下来,查看用户主目录下有没有.bash_profile文件,如果有就对它执行source命令。.bash_profile先设置用户的别名和函数,再设置用户特定的环境变量和启动脚本。 如果没有.bash_profile文件,就查看有没有.bash_login文件,并对其执行source命令。如果也没有.bash_login文件,就查看.profile文件,并执行source命令。 bash处理初始化文件的顺序: if /etc/profile exists,source it, if ~/.bash_profile exists,source it, if ~/.bashrc exists,source it, else if ~/.bash_login exists,source it, else if ~/.profile exists,source it. root用户的初始化文件就是/etc/profile 其他用户则为~/.profile
jiangsu08 于 2008-01-17 21:45:42发表:
~/.bash_login文件没有 但有一个.bash_logout ~/.profile也没有
那么red hat如何配置普通用户环境呢 ?
jiangsu08 于 2008-01-17 21:32:35发表:
谢谢 Nesoikps~~~~
Nesoikps 于 2008-01-17 21:11:40发表:
系统启动后运行的第一个进程是init,它的进程标识符PID是1。init派生出一个getty进程。该进程负责打开终端端口,提供stdin的来源,stdout与stderr的去向。接下来执行的是/bin/login程序。提示用户输入口令,加密并验证用户输入口令,设置初始化环境,启动用户的登陆shell,即bash。
bash有很多的启动文件,这些文件是可以执行source命令。登陆shell时,先对系统初始化文件/etc/profile执行source命令。接下来,查看用户主目录下有没有.bash_profile文件,如果有就对它执行source命令。.bash_profile先设置用户的别名和函数,再设置用户特定的环境变量和启动脚本。
如果没有.bash_profile文件,就查看有没有.bash_login文件,并对其执行source命令。如果也没有.bash_login文件,就查看.profile文件,并执行source命令。
bash处理初始化文件的顺序:
if /etc/profile exists,source it,
if ~/.bash_profile exists,source it,
if ~/.bashrc exists,source it,
else if ~/.bash_login exists,source it,
else if ~/.profile exists,source it.
root用户的初始化文件就是/etc/profile
其他用户则为~/.profile