- 这里需要安装bash-completion
$sudo port install bash-completion
- 添加到.bash_profile
# bash-completion
if [ -f /opt/local/etc/profile.d/bash_completion.sh ]; then
. /opt/local/etc/profile.d/bash_completion.sh
fi
- 大致效果如下,以ls加tab键为例
fdhuang@phodal:~ $ ls
ls lsbom lsock lsockU lsvfs
lsappinfo lsm lsockT lsof
fdhuang@phodal:~ $ ls
不过一种更理想的方式就是使用zsh
或许您还需要下面的文章: