您的系統管理員已經提供您一些組態設定檔﹐如: .xinitrc
, .bash_profile
, .inputrc
, 等等。
其中您想要編輯的是:
.bash_profile
或是 .profile
: 在 login 時﹐這個檔案就被 Shell 給讀進來了。就像 VMS 上的 LOGIN.COM
;
.bash_logout
: 當要登出的時候﹐讀取這個檔案。這就像 VMS 上的 LOGOUT.COM
;
.bashrc
: 被 non--login shells 讀取.
.inputrc
: 這個檔案可以定做一組合鍵和設定 shell 的行為。
我將以我的 .bash_profile
最為實例。
# $HOME/.bash_profile # 如果不需要﹐請不要重新定義 $PATH 變數。 echo $PATH | grep $LOGNAME > /dev/null if [ $? != 0 ] then export PATH="$PATH:/home/$LOGNAME/bin" # add my dir to the PATH fi export PS1='LOGNAME:\w\$ ' export PS2='Continued...>' # aliases 別名 alias bin="cd ~/bin" ; alias cp="cp -i" ; alias d="dir" alias del="delete" ; alias dir="/bin/ls $LS_OPTIONS --format=vertical" alias ed="jed" ; alias mv='mv -i' alias u="cd .." ; alias undel="undelete" # A few useful functions 一些有用的函數!酷! inst() # Install a .tar.gz archive in current directory. { gzip -dc $1 | tar xvf - } cz() # List the contents of a .zip archive. { unzip -l $* } ctgz() # List the contents of a .tar.gz archive. { for file in $* ; do gzip -dc ${file} | tar tf - done } tgz() # Create a .tgz archive a la zip. { name=$1 ; tar -cvf $1 ; shift tar -rf ${name} $* ; gzip -S .tgz ${name} }
這是我的 .inputrc
:
# $HOME/.inputrc # 上次修改日期: 16 January 1997. # # 以下是註解﹐說明這個 Script 的用意。 # This file is read by bash and defines key bindings to be used by the shell; # what follows fixes the keys END, HOME, and DELETE, plus accented letters. # For more information, man readline. "\e[1~": beginning-of-line "\e[3~": delete-char "\e[4~": end-of-line set bell-style visible set meta-flag On set convert-meta Off set output-meta On set horizontal-scroll-mode On set show-all-if-ambiguous On # (F1 .. F5) are "\e[[A" ... "\e[[E" "\e[[A": "info "