2 Config HOWTO 系统设置( 二 )



#;fix;the;backspace;key;in;rxvt/xterm
#;设定rxvt/xterm中的退後键

CTRL_H="10"
NULL_STRING=";$CTRL_H";#;space; ;backspace
if;[;"$NULL_STRING";!=;"";];;;then
stty;erase;^?
else
stty;erase;^H
fi

#;set;xterm;title:;full;path
case;$TERM;in
xterm*)
PROMPT_COMMAND="echo;-ne;"33]0;${USER}@${HOSTNAME}:;${PWD}07""

esac

for;i;in;/etc/profile.d/*.sh;;;do
if;[;-x;$i;];;then
.;$i;#;beware;-;variables;and;aliases;might;get;overridden!
fi
done

#;call;fortune,;if;available;;--如有fortune
if;[;-x;/usr/games/fortune;];;;then
echo;;;/usr/games/fortune;;;echo
fi


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

此处为;/etc/bashrc:;



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

#;/etc/bashrc

#;System;wide;functions;and;aliases
#;整个系统的功能和别名
#
#;Environment;stuff;goes;in;/etc/profile
#;/etc/profile中的环境参数
#
#;Insert;PS1;definitions;here;if;you;experience;problems.
#;如有问题可将PS1的参数放在此处

export;CDPATH="$CDPATH:

#;common;aliases;--共同别名

alias;cp="cp;-i"
alias;l=less
alias;ls="ls;$LS_OPTIONS"
alias;mv="mv;-i"
alias;rm="rm;-i"
alias;rmbk="/bin/rm;-f;.*
alias;u="cd;.."
alias;which="type;-path"
alias;x=startx

#;A;few;useful;functions;--几项有用的功能

c;();;;;#;cd;to;the;new;directory;and;list;its;contents
{
cd;$1;;;ls
}

inst();;#;Install;a;.tar.gz;archive;in;current;directory;--在当前目录中建立.tar.gz储存库
{
if;[;$#;!=;0;];;then;tar;zxvf;$1;;fi
}

cz();;;;#;List;the;contents;of;a;.zip;archive;--列出.zip的内容
{
if;[;$#;!=;0;];;then;unzip;-l;$*;;fi
}

ctgz();;#;List;the;contents;of;a;.tar.gz;archive;--列出.tar.gz的内容
{
for;file;in;$*;;;do
tar;ztf;${file}
done
}

tgz();;;#;Create;a;.tgz;archive;a;la;zip.;--建立压缩档.tgz
{
if;[;$#;!=;0;];;then
name=$1.tar;;shift;;tar;-rvf;${name};$*;;;gzip;-9;${name}
fi
}

crpm();;#;list;information;on;an;.rpm;file;--列出.rpm档的内容
{
if;[;$#;!=;0;];;then;rpm;-qil;$1;|;less;;fi
}


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

此处为;.bashrc:;



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

#;$HOME/.bashrc
#;Source;global;definitions

if;[;-f;/etc/bashrc;];;then
.;/etc/bashrc
fi

#;this;is;needed;to;notify;the;user;that;they;are;in;non-login;shell
#;需要以下设定 , 以便通知处於不登录(non-login)外围程序(shell)中的用户

if;[;"$GET_PS1";=;"";];;;then
COLOUR=45;;ESC="33";;STYLE=";1m";;;#;STYLE="m"
USER=`whoami`
export;PS1="[$ESC[$COLOUR;37$STYLE]$USER:[$ESC[37;40$STYLE]w$;"
fi

#;personal;aliases
#;个人别名

alias;backup="tar;-Mcvf;/dev/fd0"
alias;dial="eznet;up;myisp"
alias;f="cd;
alias;hangup="eznet;down"
alias;lyx="lyx;-width;580;-height;450"
alias;restore="tar;-M;-xpvf;/dev/fd0"

#;personal;functions
#;几个个人使用的功能

xj();;;;#;Launch;xjed;and;a;file;in;background;--在背景启动xjed和文档
{
xjed;$1;&
}


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

此处为.bash_profile:;



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

#;$HOME/.bash_profile

#;User;specific;environment;and;startup;programs
#;用户特定的环境参数和启动程式
#
#;This;file;contains;user-defined;settings;that;override
#;those;in;/etc/profile
#;这个文档中存有用户自订的设置 , 可取代/etc/profile;中的数值
#
#;Get;aliases;and;functions

推荐阅读