over 6 years ago
檔案位置 {system root}/etc/bashrc
編輯 bashrc 檔案(如果無法編輯可用 sudo su),將以下 copy paste 覆蓋內容,
完成後關掉終端機重新打開。
# System-wide .bashrc file for interactive bash(1) shells.
if [ -z "$PS1" ]; then
return
fi
#PS1='\h:\W \u\$ '
PS1='\[\e[0;33m\]\u \[\e[0;31m\]@ \[\e[0;32m\]\h \[\e[0;31m\]: \[\e[0;35m\]\w \[\e[0;37m\]\$ '
#PS1="\$(date +%H:%M) \[\033[1;32m\]\u@\[\033[0m\h\[\033[0m\]\[\033[1;36m\]:\w\[\033[0m\]$"
# Make bash check its window size after a process completes
shopt -s checkwinsize
# Tell the terminal about the working directory at each prompt.
if [ "$TERM_PROGRAM" == "Apple_Terminal" ] && [ -z "$INSIDE_EMACS" ]; then
update_terminal_cwd() {
# Identify the directory using a "file:" scheme URL,
# including the host name to disambiguate local vs.
# remote connections. Percent-escape spaces.
local SEARCH=' '
local REPLACE='%20'
local PWD_URL="file://$HOSTNAME${PWD//$SEARCH/$REPLACE}"
printf '\e]7;%s\a' "$PWD_URL"
}
PROMPT_COMMAND="update_terminal_cwd; $PROMPT_COMMAND"
fi
#terminal color
export PS1
export CLICOLOR='true'
export LSCOLORS='exfxcxdxbxegedabagacad'