当前位置: 首页 > 图文教程 > 操作系统 > Unix/Linux > Config HOWTO 系统设置 (2)

Unix/Linux
mysql+httpd+gd+php+zend
automake 小回顾
unix黑客精神的最好诠释
www
sun t3存储的设置
RPM简明中文手册
Linux爱好者入门教程 序章 (持续更新)
第一章 Linux基础知识 (飘心)
linux下进程与线程
浅谈如何学习linux
第二章 Linux安装
硬件安装指南
Windows 2000 的桌面不見了的解決方法
部分的ADSL路由器默认帐号密码
如何设定安全log服务器呢?
iptables 规则速查
网友学习 Linux 的七点忠告
sniffer的含义及原理
Linux编程白皮书 第二章 内存管理
Linux编程白皮书 第二章 内存管理 2.1.1 请求调页 --2.1.5 访问控制

Unix/Linux 中的 Config HOWTO 系统设置 (2)


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-11-01   浏览: 139 ::
收藏到网摘: n/a

  --------------------------------------------------------------------------------

4. 软件设置

下列设置档必需加以设定:/etc/profile /etc/bashrc .bashrc .bashrc .bash_profile .bash_logout .inputrc .less .lessrc .xinitrc .fvwmrc .fvwm2rc95 .Xmodmap .Xmodmap.num .Xdefaults .jedrc .abbrevs.sl .joerc .emacs . 在完成系统设定以前不要增添用户;需要将点文档(dot files)放入/etc/skel。 


4.1 bash(1) 
有人认为,这个软件是除内核之外最重要的软件。要使bash适合个人口味,可修改下列文档: 


/etc/bashrc 存有整个系统的别名和功能; 
/etc/profile 存有整个系统的环境参数和启动程式; 
$HOME/.bashrc 存有用户的的别名和功能; 
$HOME/.bash_profile 存有用户的环境参数和启动程式; 
$HOME/.inputrc 存有主要绑定数值和其他位元数值; 
下文例举对这些文档的修改。首先,最重要的文档是:/etc/profile。以下几节中可以看到,修改这个文档可以设定 Linux 的各种功能。 



--------------------------------------------------------------------------------

# /etc/profile

# System wide environment and startup programs
# --整个系统环境和启动程式
#
# Functions and aliases go in /etc/bashrc
# --/etc/bashhrc中包含功能和别名
#
# This file sets up the following features and programs:
# --这个文档设定下列功能:
#
#   o path --路径
#   o prompts  --提示符
#   o a few environment variables  --几个环境变数
#   o colour ls --ls 的颜色
#   o less behaviour    --设定less的功能 
#   o rxvt
#
# Users can override these settings and/or add others in their
# $HOME/.bash_profile
# 用户可在 $HOME/.bash_profile 中取消这些设定和(或)增加其他设定


# set a decent path
# 设定可行的路径

PATH="$PATH:/usr/X11R6/bin:$HOME/bin:."

# notify the user: login or non-login shell. If login, the prompt is
# coloured in blue; otherwise in magenta. Root's prompt is red.
# See the Colour-ls mini  HOWTO  for an explanation of the escape codes.
# 通知用户:登录(login)或不登录(non-login)的外围程序(shell)。
# 如果登录,则提示符为蓝色,否则为紫红色。Root的提示符为红色。
# 参阅Colour-ls mini  HOWTO 中对换码符(escape codes)的使用解释。

USER=`whoami`
if [ $LOGNAME = $USER ] ; then
  COLOUR=44  # blue --蓝色
else
  COLOUR=45  # magenta --紫红色
fi

if [ $USER = 'root' ] ; then
  COLOUR=41  # red --红色
  PATH="$PATH:/usr/local/bin"
fi

ESC="\033"
PROMPT='\h'    # hostname --主机名
STYLE=';1m'    # bold --粗体
# PROMPT='\u'  # username --用户名
# STYLE='m'    # plain --一般字体
PS1="\[$ESC[$COLOUR;37$STYLE\]$PROMPT:\[$ESC[37;40$STYLE\]\w\\$ "
PS2="> "

# no core dumps, please
# 请勿转储内存信息

ulimit -c 0

# set umask
# 设定umask

if [ `id -gn` = `id -un` -a `id -u` -gt&n