사용하시는 계정이 aaa라면
처음에 서버에 접속하면 서버사용의 환경설정을 하는 파일이
/etc/profile
입니다.
이 파일은 모든 사용자들에게 적용되는 환경설정이죠....
그런후에...
계정별로 개별적인 환경사용을 위해
이 파일(/etc/profile)에서 다시 aaa의 홈디렉토리(예 : /home/aaa ) 내에 있는 .bash_profile이 그 환경설정을 합니다. 이 파일은 계정별 개별설정을 위한 파일이지요. 개별설정을 별달리 하지 않으셨다면 원상태 그대로 있을 겁니다.
이 .bash_profile에서 다시 .bashrc 라는 파일을 불러들입니다.
이 .bashrc라는 파일에서 다시 /etc/bashrc라는 파일을 불러들이죠...
결론적으로 개별설정을 별달리 하지 않으셨다면 결론적으로 /etc/bashrc의 파일의 적용을 받게 됩니다. 이 파일의 가장 일반적인 형태는 아래와 같습니다.
|
# /etc/bashrc
# System wide functions and aliases # Environment stuff goes in /etc/profile
# by default, we want this to get set. # Even for non-interactive, non-login shells. if [ `id -gn` = `id -un` -a `id -u` -gt 99 ]; then umask 002 else umask 022 fi
# are we an interactive shell? if [ "$PS1" ]; then if [ -x /usr/bin/tput ]; then if [ "x`tput kbs`" != "x" ]; then # We can't do this with "dumb" terminal stty erase `tput kbs` elif [ -x /usr/bin/wc ]; then if [ "`tput kbs|wc -c `" -gt 0 ]; then # We can't do this with "dumb" terminal stty erase `tput kbs` fi fi fi case $TERM in xterm*) if [ -e /etc/sysconfig/bash-prompt-xterm ]; then PROMPT_COMMAND=/etc/sysconfig/bash-prompt-xterm else PROMPT_COMMAND='echo -ne "33]0;${USER}@${HOSTNAME%%.*}:${PWD/$HOME/~}07"' fi ;; *) [ -e /etc/sysconfig/bash-prompt-default ] && PROMPT_COMMAND=/etc/sysconfig/bash-prompt-default ;; esac [ "$PS1" = "\s-\v\$ " ] && PS1="[u@h W]\$ " if [ "x$SHLVL" != "x1" ]; then # We're not a login shell for i in /etc/profile.d/*.sh; do if [ -x $i ]; then . $i fi done fi fi # vim:ts=4:sw=4 |
그리고 이 파일에서 위의 빨간색 부분으로 되어 있는 부분이 프롬프트의 형태를 결정하게 됩니다.
즉, 쉘의 환경설정변수중 $PS1 의 변수값을 변경해줌으로서 프롬프트의 형태가 결정된다는 말과 동일합니다.
이부분을 적당히 수정하시면 됩니다.
설명이 좀 길었지만, 정확한 이해가 필요하기에 .....
그럼............