bash自动补全:
xxxxx-MacBook-Air:~ xxxxxx$ cat .bashrc[ -r "~/.bash_profile" ] && . "~/.bash_profile"# 配置 ll 等命令alias l='ls -alFG'alias la='ls -AFG'alias ll='ls -lAhFG'# 配置默认 python 环境#source ~/.py27/bin/activate# ssh scp 自动补全_complete_ssh_hosts (){ COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" comp_ssh_hosts=`awk '{split($1,aliases,","); \ if (aliases[1] !~ /^\[/) print aliases[1]}' \ ~/.ssh/known_hosts ; cat ~/.ssh/config | \ grep "^Host " | \ awk '{print $2}' ` COMPREPLY=( $(compgen -W "${comp_ssh_hosts}" -- $cur)) return 0}complete -F _complete_ssh_hosts sshcomplete -F _complete_ssh_hosts scp# 配置历史记录 sizeHISTSIZE=1000HISTFILESIZE=2000