<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></title> 
<link>http://www.jackxiang.com/index.php</link> 
<description><![CDATA[赢在IT，Playin' with IT,Focus on Killer Application,Marketing Meets Technology.]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></copyright>
<item>
<link>http://www.jackxiang.com/post//</link>
<title><![CDATA[Linux 查找命令find type 参数 d 和f，通过find查找删除一级目录，查找第N层级参数-maxdepth 1，留下当前目录下的tar.gz的lnmp安装包。]]></title> 
<author>jack &lt;xdy108@126.com&gt;</author>
<category><![CDATA[WEB2.0]]></category>
<pubDate>Thu, 17 Dec 2009 09:58:37 +0000</pubDate> 
<guid>http://www.jackxiang.com/post//</guid> 
<description>
<![CDATA[ 
	macbook也支持这个参数：<textarea name="code" class="php" rows="15" cols="100">
find . -type d -maxdepth 1&#124;awk &#039;&#123;print &quot;mkdir -p &quot;$1&#125;&#039;
</textarea><br/>背景：有时装lamp后会有一堆的那个目录，想对安装包如tar.gz的打包，于是要删除解压安装时生成的源码目录，于是涉及到少还成，多了得用脚本删除了。<br/>f：表示文件：<br/>find . -name &quot;*rpm*&quot; -type d //这一块如果查找目录d或文件f，必须要有一个-name &quot;xxxnamexxx&quot;,直接查目录是不行的：find .&nbsp;&nbsp;&quot;*rpm*&quot; -type d。<br/><br/>查找目录：find /（查找范围） -name &#039;查找关键字&#039; -type d<br/><textarea name="code" class="php" rows="15" cols="100">
find . -type d 
./git-2.7.4
find . -type d -maxdepth 1
./git-2.7.4
./git-2.7.4/perl
</textarea><br/>查找文件：find /（查找范围） -name 查找关键字 -print<br/>find . -type f -maxdepth 3 <br/>./d/3f/b89e893d32ff442e1384491f999ce3fd<br/>./d/4d/51c84a9975c482b8ec9f75dc727894dd<br/>./d/c1/be2597fe2aab031a1e3ef12700ea8c1d<br/>./d/ce/740cccf3e5d339e34c5c635ba94bfced<br/>./d/9e/2ba071f358130974c562aa5a81dd69ed<br/><br/>用find查找一个层级下的文件并通过grep过滤掉一些后缀文件：<br/>find -type f -maxdepth 1&#124;grep -vE &quot;tar.gz&#124;tgz&#124;gz&quot;<br/><br/><textarea name="code" class="php" rows="15" cols="100">
find . -maxdepth 2 -type f -name &quot;my.cnf&quot;
./mysql3319/my.cnf
./mysql3320/my.cnf
</textarea><br/><br/><div class="code">&#91;/home/jackxiang/ccc&#93;# find . -type f -print<br/>./a/a.txt<br/>./a.txt<br/>./b.txt<br/>./c.txt</div><br/>d:表示目录<br/><div class="code"><br/>&#91;/home/jackxiang/ccc&#93;# find . -type d -print <br/>.<br/>./a<br/></div><br/><br/>查找第一个层级的文件里包含com的文件名列表：<br/><textarea name="code" class="php" rows="15" cols="100">
find . -type f -name &quot;*com*&quot; -maxdepth 1 
./123.57.252.*(jk.jackxiang.com).ini
./101.200.228.*(root.com).ini
./47.94.88.*(stage.jackxiang.com).ini
./47.93.207.*(jackxiang.com).ini
</textarea><br/>—————————————————————————————————————————————————————————————————————<br/>一：<br/>[root@emulMachine 20120207]# find .&nbsp;&nbsp;-maxdepth 1 -type d<br/>./mysql-5.6.13<br/>./mysql-5.6.14<br/>./php-5.3.27-bak<br/>./libmcrypt-2.5.7<br/>./memcache-3.0.6<br/>二：<br/>换个位置会提醒：<br/>find . -type d&nbsp;&nbsp;-maxdepth 1<br/>find: warning: you have specified the -maxdepth option after a non-option argument -type, but options are not positional (-maxdepth affects tests specified before it as well as those specified after it).&nbsp;&nbsp;Please specify options before other arguments.<br/><br/>　-maxdepth&lt;目录层级&gt; 　设置最大目录层级。<br/><br/><textarea name="code" class="php" rows="15" cols="100">
find . -type f -maxdepth 1&#124;grep -v &quot;tgz&quot;&#124;grep -v &quot;tar&quot; 
</textarea><br/>摘自：http://blog.csdn.net/windone0109/article/details/2817792<br/><br/>
]]>
</description>
</item><item>
<link>http://www.jackxiang.com/post//#blogcomment</link>
<title><![CDATA[[评论] Linux 查找命令find type 参数 d 和f，通过find查找删除一级目录，查找第N层级参数-maxdepth 1，留下当前目录下的tar.gz的lnmp安装包。]]></title> 
<author> &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate> 
<guid>http://www.jackxiang.com/post//#blogcomment</guid> 
<description>
<![CDATA[ 
	
]]>
</description>
</item>
</channel>
</rss>