# .bashrc
2 3 # Source global definitions 4 if [ -f /etc/bashrc ]; then 5 . /etc/bashrc 6 fi 7 8 # Uncomment the following line if you don't like systemctl's auto-paging feature: 9 # export SYSTEMD_PAGER= 10 11 # User specific aliases and functions 12 ## カスタマイズ設定 13 # プロンプトの設定 14 case ${UID} in 15 0) 16 PS1='\[\033[31m\]${PWD}\n\$\[\033[0m\]' 17 PS2='\[\033[31m\]>\[\033[0m\] ' 18 [ -n "${REMOTEHOST}${SSH_CONNECTION}" ] && PS1='\[\033[30m\]\h'" ${PS1}" 19 ;; 20 *) 21 PS1='\[\033[37m\]\w:\n\$\[\033[0m\] ' 22 PS2='\[\033[37m\]$\[\033[0m\] ' 23 [ -n "${REMOTEHOST}${SSH_CONNECTION}" ] && PS1='\[\033[36m\]\D{%F} \t \u@\h'" ${PS1}" 24 ;; 25 esac 26 27 # ターミナルの表示設定 28 case "${TERM}" in 29 kterm*|xterm) 30 PROMPT_COMMAND='echo -e "\033]0;'"${USER}@${HOSTNAME%%.*}:"'${PWD}\007\c"' 31 ;; 32 esac 33 34 # ヒストリ系の環境変数の設定 35 export HISTSIZE=1000 36 export HISTFILESIZE=10000 37 export HISTCONTROL=ignoredups 38 export HISTIGNORE=?:??:exit 39 export HISTFILE=~/.bash_history/.bash_history-$OSTYPE-`date +%Y%m%d`
# 標準エディタ環境変数の設定
42 EDITOR=vim 43 44 # ロケール環境変数の設定 45 LANG=ja_JP.UTF-8 46 47 # パスの設定 48 PATH=$PATH:~/bin 49 50 export PATH LANG EDITOR 51 52 # .inputrcの読み込み 53 [ -f ~/.inputrc ] && bind -f ~/.inputrc 54 55 # エイリアス 56 alias la="ls -la --color=auto" 57 alias l="ls --color=auto" 58 alias v="vim" 59 alias w="wget" 60 alias h="history" 61 alias hst="history" 62 alias cdh="cd /var/www/html" 63 alias cds="cd /var/www/html/seihan" 64 alias cp="cp -b" 65 alias mv="mv -b" 66 alias rm="rm -i" 67 68 #CD->LS 69 cdls () 70 { 71 \cd "$@" && la --color=auto 72 echo 'Success!' 73 } 74 alias cd="cdls"