首页 > Linux > bash_completion install in Mac OS X Snow Leopard

bash_completion install in Mac OS X Snow Leopard

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 标签: , ,
  1. 2010年5月6日11:54 | #1

    是的啊

  1. 本文目前尚无任何 trackbacks 和 pingbacks.
注意: 评论者允许使用'@user空格'的方式将自己的评论通知另外评论者。例如, ABC是本文的评论者之一,则使用'@ABC '(不包括单引号)将会自动将您的评论发送给ABC。使用'@all ',将会将评论发送给之前所有其它评论者。请务必注意user必须和评论者名相匹配(大小写一致)。直接点击评论上方的回复实现此功能