转--配置linux下dircolors,ls命令和mac下iTerm2的颜色,让终端(iTerm2或Terminal)也色彩缤纷

时间:2024-10-05 21:07:08

http://blog.bbkanba.com/%E9%85%8D%E7%BD%AElinux%E4%B8%8Bdircolorsls%E5%91%BD%E4%BB%A4%E5%92%8Cmac%E4%B8%8Biterm2%E7%9A%84%E9%A2%9C%E8%89%B2%E8%AE%A9%E7%BB%88%E7%AB%AFiterm2%E6%88%96terminal%E4%B9%9F%E8%89%B2%E5%BD%A9/

cd ~
wget --no-check-certificate https://github.com/seebi/dircolors-solarized/raw/master/dircolors.ansi-universal
#or
#wget http://download.bbkanba.com/dircolors mv dircolors.ansi-universal ~/.dir_colors
eval `dircolors ~/.dir_colors`
cat >> ~/.bashrc <<ALLEND
########################################
if [ -x /usr/bin/dircolors ]; then
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'
alias tree='tree -C'
fi
########################################
ALLEND
source ~/.bashrc
ls