<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: 10 个实用的 Bash alias</title>
	<atom:link href="http://www.linuxtoy.org/archives/10-bash-alias.html/feed" rel="self" type="application/rss+xml" />
	<link>http://linuxtoy.org/archives/10-bash-alias.html</link>
	<description>LinuxTOY 是一个致力于提供 Linux 相关资讯的专题站点。如果您发现了好用好玩的 Linux 东东并愿意发扬自由、分享的精神，可以点击顶部导航 Contact 按钮进行投稿。</description>
	<pubDate>Fri, 10 Feb 2012 07:49:37 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
		<item>
		<title>By: Toy</title>
		<link>http://linuxtoy.org/archives/10-bash-alias.html#comment-89397</link>
		<dc:creator>Toy</dc:creator>
		<pubDate>Tue, 15 Jul 2008 08:32:21 +0000</pubDate>
		<guid isPermaLink="false">http://linuxtoy.org/?p=2146#comment-89397</guid>
		<description>&lt;p&gt;@Rainux: 感谢你的补充，我重新排了一下版。&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>@Rainux: 感谢你的补充，我重新排了一下版。</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Rainux</title>
		<link>http://linuxtoy.org/archives/10-bash-alias.html#comment-89394</link>
		<dc:creator>Rainux</dc:creator>
		<pubDate>Tue, 15 Jul 2008 08:10:55 +0000</pubDate>
		<guid isPermaLink="false">http://linuxtoy.org/?p=2146#comment-89394</guid>
		<description>&lt;p&gt;阿哦，排版乱掉了，请自己在  vim 里 gg=G 排版一下吧。&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>阿哦，排版乱掉了，请自己在  vim 里 gg=G 排版一下吧。</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Rainux</title>
		<link>http://linuxtoy.org/archives/10-bash-alias.html#comment-89393</link>
		<dc:creator>Rainux</dc:creator>
		<pubDate>Tue, 15 Jul 2008 08:10:05 +0000</pubDate>
		<guid isPermaLink="false">http://linuxtoy.org/?p=2146#comment-89393</guid>
		<description>&lt;p&gt;好吧，我出必杀了。虽然不是 alias。&lt;/p&gt;

&lt;p&gt;用于在当前目录以及所有子目录中搜索包含特定 pattern 的文件，可以用 pattern 来过滤将要搜索的文件名。&lt;/p&gt;

&lt;p&gt;用法:
&lt;pre&gt;&lt;code&gt;
  grep&lt;em&gt;for pattern&lt;/em&gt;to&lt;em&gt;search
  grep&lt;/em&gt;for pattern&lt;em&gt;to&lt;/em&gt;search &#46;rb$
  gvim &lt;code&gt;grep_for pattern_to_search \.rb$ -l&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;grep_for() {
    local content=$1&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;if [ -z "$2" ]
then
    shift
else
    local flag=`echo $2 &#124; sed 's/^\(.\).*$/\1/'`
    if [ "$flag" == "-" ]
    then
        shift
    else
        local filter=$2
        shift
        shift
    fi  
fi  


if [ -z "$filter" ]
then
    find -print0 &#124; grep -zv '\.svn' &#124; xargs -0 grep --color $content $@
else
    find -print0 &#124; grep -zv '\.svn' &#124; grep -z $filter &#124; xargs -0 grep --color $content $@
fi  
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;}
&lt;/code&gt;&lt;/pre&gt;&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>好吧，我出必杀了。虽然不是 alias。</p>

<p>用于在当前目录以及所有子目录中搜索包含特定 pattern 的文件，可以用 pattern 来过滤将要搜索的文件名。</p>

<p>用法:
<pre><code>
  grep<em>for pattern</em>to<em>search
  grep</em>for pattern<em>to</em>search &#46;rb$
  gvim </code><code>grep_for pattern_to_search \.rb$ -l</code></pre></p>

<p>grep_for() {
    local content=$1</p>

<pre><code>if [ -z "$2" ]
then
    shift
else
    local flag=`echo $2 | sed 's/^\(.\).*$/\1/'`
    if [ "$flag" == "-" ]
    then
        shift
    else
        local filter=$2
        shift
        shift
    fi  
fi  


if [ -z "$filter" ]
then
    find -print0 | grep -zv '\.svn' | xargs -0 grep --color $content $@
else
    find -print0 | grep -zv '\.svn' | grep -z $filter | xargs -0 grep --color $content $@
fi  
</code></pre>

<p>}
</p>]]></content:encoded>
	</item>
	<item>
		<title>By: baj</title>
		<link>http://linuxtoy.org/archives/10-bash-alias.html#comment-89358</link>
		<dc:creator>baj</dc:creator>
		<pubDate>Mon, 14 Jul 2008 14:53:30 +0000</pubDate>
		<guid isPermaLink="false">http://linuxtoy.org/?p=2146#comment-89358</guid>
		<description>&lt;p&gt;我也帖一个，呵呵：
alias ..='cd ..'
alias ...='cd ../..'
alias cd..='cd ..'
alias cls='clear'
alias egrep='egrep --color -n'
alias fm='free -mt'
alias gi='gvim'
alias git-diff='git-diff --color'
alias grep='grep --colour=auto'
alias info='pinfo'
alias ki='kwrite'
alias l='ls -alF'
alias l.='ls -a .* -d'
alias la='ls -la'
alias ll='ls -l'
alias ls='ls --color=auto'
alias mat='matlab -nodesktop -nosplash'
alias o='less'
alias pa='ps aux'
alias pe='ps -e'
alias pt='pstree'&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>我也帖一个，呵呵：
alias ..='cd ..'
alias ...='cd ../..'
alias cd..='cd ..'
alias cls='clear'
alias egrep='egrep --color -n'
alias fm='free -mt'
alias gi='gvim'
alias git-diff='git-diff --color'
alias grep='grep --colour=auto'
alias info='pinfo'
alias ki='kwrite'
alias l='ls -alF'
alias l.='ls -a .* -d'
alias la='ls -la'
alias ll='ls -l'
alias ls='ls --color=auto'
alias mat='matlab -nodesktop -nosplash'
alias o='less'
alias pa='ps aux'
alias pe='ps -e'
alias pt='pstree'</p>]]></content:encoded>
	</item>
	<item>
		<title>By: DS</title>
		<link>http://linuxtoy.org/archives/10-bash-alias.html#comment-89287</link>
		<dc:creator>DS</dc:creator>
		<pubDate>Sun, 13 Jul 2008 07:19:40 +0000</pubDate>
		<guid isPermaLink="false">http://linuxtoy.org/?p=2146#comment-89287</guid>
		<description>&lt;p&gt;楼上的增强版&lt;/p&gt;

&lt;p&gt;str='..'
level='./../'
for i in &lt;code&gt;seq 1 10&lt;/code&gt;;
do
    eval "alias '$str=cd $level'"
    level=$level'../'
    str=$str'.'
done&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>楼上的增强版</p>

<p>str='..'
level='./../'
for i in <code>seq 1 10</code>;
do
    eval "alias '$str=cd $level'"
    level=$level'../'
    str=$str'.'
done</p>]]></content:encoded>
	</item>
	<item>
		<title>By: robbie</title>
		<link>http://linuxtoy.org/archives/10-bash-alias.html#comment-89276</link>
		<dc:creator>robbie</dc:creator>
		<pubDate>Sat, 12 Jul 2008 15:30:59 +0000</pubDate>
		<guid isPermaLink="false">http://linuxtoy.org/?p=2146#comment-89276</guid>
		<description>&lt;p&gt;加1个&lt;/p&gt;

&lt;p&gt;alias ...='cd ../..'&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>加1个</p>

<p>alias ...='cd ../..'</p>]]></content:encoded>
	</item>
	<item>
		<title>By: chenxing</title>
		<link>http://linuxtoy.org/archives/10-bash-alias.html#comment-89255</link>
		<dc:creator>chenxing</dc:creator>
		<pubDate>Sat, 12 Jul 2008 01:45:35 +0000</pubDate>
		<guid isPermaLink="false">http://linuxtoy.org/?p=2146#comment-89255</guid>
		<description>&lt;p&gt;alias convmv-utf8=”convmv -f gbk -t utf-8 –notest”
这个，有点危险吧，可以先把--notest拿到外面~&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>alias convmv-utf8=”convmv -f gbk -t utf-8 –notest”
这个，有点危险吧，可以先把--notest拿到外面~</p>]]></content:encoded>
	</item>
	<item>
		<title>By: qiang_liu8183</title>
		<link>http://linuxtoy.org/archives/10-bash-alias.html#comment-89252</link>
		<dc:creator>qiang_liu8183</dc:creator>
		<pubDate>Fri, 11 Jul 2008 18:57:22 +0000</pubDate>
		<guid isPermaLink="false">http://linuxtoy.org/?p=2146#comment-89252</guid>
		<description>&lt;p&gt;也来贡献几个&lt;/p&gt;

&lt;p&gt;alias x='startx'
alias sd='sudo poweroff'
alias rb='sudo reboot'
alias Scc='sudo pacman -Scc'
alias Syu='sudo pacman -Syu'
alias ls='ls -a --color=auto'
alias ll='ls -l'
alias ..='cd ..'
alias ubuntu='lftp username:password@ftp.ubuntu.org.cn'&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>也来贡献几个</p>

<p>alias x='startx'
alias sd='sudo poweroff'
alias rb='sudo reboot'
alias Scc='sudo pacman -Scc'
alias Syu='sudo pacman -Syu'
alias ls='ls -a --color=auto'
alias ll='ls -l'
alias ..='cd ..'
alias ubuntu='lftp username:password@ftp.ubuntu.org.cn'</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Toy</title>
		<link>http://linuxtoy.org/archives/10-bash-alias.html#comment-89246</link>
		<dc:creator>Toy</dc:creator>
		<pubDate>Fri, 11 Jul 2008 14:03:43 +0000</pubDate>
		<guid isPermaLink="false">http://linuxtoy.org/?p=2146#comment-89246</guid>
		<description>&lt;p&gt;@zhuqin：汗，笔误，已修正。&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>@zhuqin：汗，笔误，已修正。</p>]]></content:encoded>
	</item>
	<item>
		<title>By: wanzigunzi</title>
		<link>http://linuxtoy.org/archives/10-bash-alias.html#comment-89245</link>
		<dc:creator>wanzigunzi</dc:creator>
		<pubDate>Fri, 11 Jul 2008 13:57:33 +0000</pubDate>
		<guid isPermaLink="false">http://linuxtoy.org/?p=2146#comment-89245</guid>
		<description>&lt;p&gt;df不如用df -Th&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>df不如用df -Th</p>]]></content:encoded>
	</item>
</channel>
</rss>

