debian; ubuntu; kali / 未分类 · 2014年7月19日

debian 修改默认SHELL及彩色终端

1.debian 修改默认 SHELL ( dash 改 为bash )
debian 默认shell为 dash ,对于常用bash来说的我,不习惯,改之,如下
evan@latop:~$ cat /etc/passwd | grep evan
evan:x:1000:1001::/home/evan:/bin/bash
sudo mv /bin/sh /bin/baksh && sudo ln -s /bin/bash /bin/sh
2. 终端彩色和一些常用alias
终端彩色 这个太多了,其实觉得我下面这个就够了
cp /etc/skel/.bashrc ~/ && . /root/.bashrc
evan@latop:~$ cat .bashrc
alias halt='sudo poweroff'
export LANG=zh_CN.utf8
alias vi=vim
#alias firefox=iceweasel
alias firefox=/home/evan/program/firefox/firefox
alias thunderbird=icedove
alias ll='ls -l'
alias ifconfig='/sbin/ifconfig'
alias eclipse='/home/evan/program/eclipse/eclipse'
alias pssh='parallel-ssh'
alias pscp='parallel-scp'
alias prsync='parallel-rsync'
export PSSH_HOSTS="/root/servers.txt"
export PSSH_USER="root"
export PSSH_PAR="32"
export PSSH_OUTDIR="/tmp"
export PSSH_VERBOSE="0"
export PSSH_OPTIONS="UserKnownHostsFile /root/.ssh/known_hosts"
# by evan
# uncomment for a colored prompt, if the terminal has the capability; turned
# off by default to not distract the user: the focus in a terminal window
# should be on the output of commands, not on the prompt
force_color_prompt=yes
if [ -n "$force_color_prompt" ]; then
if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
# We have color support; assume it's compliant with Ecma-48
# (ISO/IEC-6429). (Lack of such support is extremely rare, and such
# a case would tend to support setf rather than setaf.)
color_prompt=yes
else
color_prompt=
fi
fi
if [ "$color_prompt" = yes ]; then
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;31m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
else
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
fi
unset color_prompt force_color_prompt
# If this is an xterm set the title to user@host:dir
case "$TERM" in
xterm*|rxvt*)
PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
;;
*)
;;
esac
# enable color support of ls and also add handy aliases
if [ -x /usr/bin/dircolors ]; then
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
alias ls='ls --color=auto'
#alias dir='dir --color=auto'
#alias vdir='vdir --color=auto'
#alias grep='grep --color=auto'
#alias fgrep='fgrep --color=auto'
#alias egrep='egrep --color=auto'
fi