存档

文章标签 ‘雪豹’

bash_completion install in Mac OS X Snow Leopard

2010年5月5日 1 条评论

Recently,I Try to use the Snow Leopard ,But it lacks a feature.

Debian-like bash_completion! I missed you! So I Seached with Google!

To install it just do:

sudo port install bash-completion
echo "source /opt/local/etc/bash_completion" >> ~/.bash_profile
chmod +x ~/.bash_profile

Tip: You must have MacPorts installed to run the first command. MacPorts Form http://www.macports.org .

If you don’t know yet what is bash_completion, it is  a feature for shells to autocomplete commands. Example: You are on a git repository. You type git fe and press TAB, bash_completion will fill “fetch” for you. If you have branches, they are autocompleted too. GNU Tar only shows files compatible with the filters you selected. So if you tar xvzf my-softw TAB, it will complete only filenames that are on tar.gz or tgz format and that starts with the string you already typed.

It is heaven again.

分类: Linux 标签: , ,