<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>男单 618 &#187; grep</title>
	<atom:link href="http://www.ai7.org/wp/html/tag/grep/feed" rel="self" type="application/rss+xml" />
	<link>http://www.ai7.org/wp</link>
	<description>生活象筒装的卫生纸，开始的时候怎么扯都不觉得在转，后来转的越来越快。</description>
	<lastBuildDate>Sun, 11 Dec 2011 12:22:49 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.1</generator>
		<item>
		<title>用grep在子目录中指定的文件类型中查找</title>
		<link>http://www.ai7.org/wp/html/653.html</link>
		<comments>http://www.ai7.org/wp/html/653.html#comments</comments>
		<pubDate>Mon, 21 Dec 2009 16:08:01 +0000</pubDate>
		<dc:creator>amao</dc:creator>
				<category><![CDATA[软件]]></category>
		<category><![CDATA[find]]></category>
		<category><![CDATA[grep]]></category>

		<guid isPermaLink="false">http://www.ai7.org/wp/html/653.html</guid>
		<description><![CDATA[grep -r abcd *.py 这样的命令得不到你期待的结果，而 grep -r abcd * 这样得到的结果又太多，仍然不是你想要的。 正解是： find . -name *.py&#124;xargs grep asdf 注：这是一个困惑我很久的问题，今天在 这里看到 一种解决方案 。 有人在留言中给出另外一种方法 find . -iname ‘*.cc’ -exec grep -nH ‘{}’ \; 但是看上去比较复杂，我不喜欢。<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">相关文章：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.ai7.org%2Fwp%2Fhtml%2F916.html&from=http%3A%2F%2Fwww.ai7.org%2Fwp%2Fhtml%2F653.html">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Python处理pdf文件的包</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.ai7.org%2Fwp%2Fhtml%2F260.html&from=http%3A%2F%2Fwww.ai7.org%2Fwp%2Fhtml%2F653.html">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">文件类型探测器——GT2（原名GetTyp）</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.ai7.org%2Fwp%2Fhtml%2F74.html&from=http%3A%2F%2Fwww.ai7.org%2Fwp%2Fhtml%2F653.html">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">不知道有没有这样的文件管理器</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.ai7.org%2Fwp%2Fhtml%2F41.html&from=http%3A%2F%2Fwww.ai7.org%2Fwp%2Fhtml%2F653.html">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">TeX文件的字数统计</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<blockquote><p>grep -r abcd  *.py</p></blockquote>
<p>这样的命令得不到你期待的结果，而</p>
<blockquote><p>grep -r abcd *</p></blockquote>
<p>这样得到的结果又太多，仍然不是你想要的。</p>
<p>正解是：</p>
<blockquote><p>find . -name *.py|xargs grep asdf</p></blockquote>
<p>注：这是一个困惑我很久的问题，今天在 这里看到 <a class="reference external" href="http://www.joyloft.net/?p=1219">一种解决方案</a> 。 有人在留言中给出另外一种方法</p>
<blockquote><p>find . -iname ‘*.cc’ -exec grep -nH ‘{}’ \;</p></blockquote>
<p>但是看上去比较复杂，我不喜欢。</p>
<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">相关文章：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.ai7.org%2Fwp%2Fhtml%2F916.html&from=http%3A%2F%2Fwww.ai7.org%2Fwp%2Fhtml%2F653.html">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Python处理pdf文件的包</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.ai7.org%2Fwp%2Fhtml%2F260.html&from=http%3A%2F%2Fwww.ai7.org%2Fwp%2Fhtml%2F653.html">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">文件类型探测器——GT2（原名GetTyp）</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.ai7.org%2Fwp%2Fhtml%2F74.html&from=http%3A%2F%2Fwww.ai7.org%2Fwp%2Fhtml%2F653.html">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">不知道有没有这样的文件管理器</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.ai7.org%2Fwp%2Fhtml%2F41.html&from=http%3A%2F%2Fwww.ai7.org%2Fwp%2Fhtml%2F653.html">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">TeX文件的字数统计</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://www.ai7.org/wp/html/653.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

