存档

文章标签 ‘bash’

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 标签: , ,

Add Bash Completion In Debian

2010年3月16日 2 条评论

Bash completion is a useful tool for completion of file paths, commands etc. By default it is enabled on Ubuntu but not on Debian. With two simple steps it can also be enabled on Debian.

1. Install bash-completion

First of all we need the install the according package:
阅读全文...

分类: Linux 标签: , ,

Bash 使用技巧大补贴

2010年3月10日 没有评论

Bash 是我们经常与之打交道的 Shell 程序,本文针对其使用技巧进行了搜罗。相信在你看过这些内容之后,定会在 Bash 的世界里游刃有余。
阅读全文...

分类: Linux 标签: ,

linux启动是自动加载的几个文件说明bashrc等

2010年2月25日 2 条评论

(1)/etc/profile
全局(公有)配置,不管是哪个用户,登录时都会读取该文件。

(2)/ect/bashrc
Ubuntu没有此文件,与之对应的是/ect/bash.bashrc
它也是全局(公有)的
bash执行时,不管是何种方式,都会读取此文件。

(3)~/.profile
若bash是以login方式执行时,读取~/.bash_profile,若它不存在,则读取~/.bash_login,若前两者不存在,读取~/.profile。
另外,图形模式登录时,此文件将被读取,即使存在~/.bash_profile和~/.bash_login。
阅读全文...

分类: Linux 标签: , , ,