<?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>Neo&#039;s notes &#187; Linux</title>
	<atom:link href="http://www.neocanable.com/category/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.neocanable.com</link>
	<description>记录一些琐碎的技术问题&#124;发泄胸中的各种不满</description>
	<lastBuildDate>Tue, 17 Jan 2012 05:37:27 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1</generator>
		<item>
		<title>install redis</title>
		<link>http://www.neocanable.com/install-redis/</link>
		<comments>http://www.neocanable.com/install-redis/#comments</comments>
		<pubDate>Thu, 22 Dec 2011 19:51:05 +0000</pubDate>
		<dc:creator>Neo</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[nosql]]></category>

		<guid isPermaLink="false">http://www.neocanable.com/?p=686</guid>
		<description><![CDATA[安装 download redis from : http://redis.io/download 1. tar xzvf redis-version.tar.gz 2. cp redis-version/redis.cnf 到 /etc/下面 cp redis-version/utils/redis_init_script到/etc/init.d/下面 cp src/redis-server 和 src/redis-cli 到/usr/local/bin下面 3.修改/etc/redis.cnf REDISPORT=6379 EXEC=/usr/local/bin/redis-server CLIEXEC=/usr/local/bin/redis-cli PIDFILE=/var/run/redis_${REDISPORT}.pid CONF=&#34;/etc/redis/${REDISPORT}.conf&#34; 4. /etc/init.d/redis start Tips about config file 1.redis默认得log是stdout,并且将bash做为自己得守护进程，如果bash进程挂掉了，那么redis-server就会退出。 修改redis.conf daemonize yes 待续&#8230;&#8230;]]></description>
			<content:encoded><![CDATA[<li>安装</li>
<p>download redis from : http://redis.io/download </p>
<p>1. tar xzvf redis-version.tar.gz</p>
<p>2. cp redis-version/redis.cnf 到 /etc/下面<br />
    cp redis-version/utils/redis_init_script到/etc/init.d/下面<br />
    cp src/redis-server 和 src/redis-cli 到/usr/local/bin下面</p>
<p>3.修改/etc/redis.cnf</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #007800;">REDISPORT</span>=<span style="color: #000000;">6379</span><br />
<span style="color: #007800;">EXEC</span>=<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>redis-server<br />
<span style="color: #007800;">CLIEXEC</span>=<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>redis-cli<br />
<br />
<span style="color: #007800;">PIDFILE</span>=<span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>run<span style="color: #000000; font-weight: bold;">/</span>redis_<span style="color: #800000;">${REDISPORT}</span>.pid<br />
<span style="color: #007800;">CONF</span>=<span style="color: #ff0000;">&quot;/etc/redis/<span style="color: #007800;">${REDISPORT}</span>.conf&quot;</span></div></div>
<p>4. /etc/init.d/redis start</p>
<li>Tips about config file</li>
<p>1.redis默认得log是stdout,并且将bash做为自己得守护进程，如果bash进程挂掉了，那么redis-server就会退出。<br />
修改redis.conf</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">daemonize <span style="color: #c20cb9; font-weight: bold;">yes</span></div></div>
<p>待续&#8230;&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.neocanable.com/install-redis/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>about linux free</title>
		<link>http://www.neocanable.com/linux-free-comman/</link>
		<comments>http://www.neocanable.com/linux-free-comman/#comments</comments>
		<pubDate>Fri, 02 Dec 2011 09:28:10 +0000</pubDate>
		<dc:creator>Neo</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.neocanable.com/?p=641</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.neocanable.com/wp-content/uploads/2011/12/linux-top-memery.png" alt="红宝书里面的，解释的详细，赞" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.neocanable.com/linux-free-comman/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>vim转换行尾恶心的^M</title>
		<link>http://www.neocanable.com/vim-tips-1/</link>
		<comments>http://www.neocanable.com/vim-tips-1/#comments</comments>
		<pubDate>Sun, 13 Nov 2011 16:53:20 +0000</pubDate>
		<dc:creator>Neo</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.neocanable.com/?p=574</guid>
		<description><![CDATA[win下面的文件到linux上后，有的时候会出现一个可恨的^M在行尾，一版用dos2unix就可以将文件转换正常 vim提供了这个支持:e ++ff=dos，切换到dos文件模式 http://vim.wikia.com/wiki/File_format]]></description>
			<content:encoded><![CDATA[<p>win下面的文件到linux上后，有的时候会出现一个可恨的^M在行尾，一版用dos2unix就可以将文件转换正常</p>
<p>vim提供了这个支持:e ++ff=dos，切换到dos文件模式</p>
<p>http://vim.wikia.com/wiki/File_format</p>
]]></content:encoded>
			<wfw:commentRss>http://www.neocanable.com/vim-tips-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>how to disable user account in linux</title>
		<link>http://www.neocanable.com/how-to-disable-user-in-linu/</link>
		<comments>http://www.neocanable.com/how-to-disable-user-in-linu/#comments</comments>
		<pubDate>Fri, 07 Oct 2011 07:19:03 +0000</pubDate>
		<dc:creator>Neo</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.neocanable.com/?p=471</guid>
		<description><![CDATA[方法1： 将/etc/shadow中的user的密码域加一个*或者! 方法2： passwd &#60;user&#62; l,解开的时候passwd &#60;user&#62; u 方法3： 将/etc/passwd中该用户那行注视掉]]></description>
			<content:encoded><![CDATA[<p>方法1：</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">将<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>shadow中的user的密码域加一个<span style="color: #000000; font-weight: bold;">*</span>或者<span style="color: #000000; font-weight: bold;">!</span></div></div>
<p>方法2：</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">passwd</span> <span style="color: #000000; font-weight: bold;">&lt;</span>user<span style="color: #000000; font-weight: bold;">&gt;</span> l,解开的时候<span style="color: #c20cb9; font-weight: bold;">passwd</span> <span style="color: #000000; font-weight: bold;">&lt;</span>user<span style="color: #000000; font-weight: bold;">&gt;</span> u</div></div>
<p>方法3：</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">将<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">passwd</span>中该用户那行注视掉</div></div>
]]></content:encoded>
			<wfw:commentRss>http://www.neocanable.com/how-to-disable-user-in-linu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>很2的将boot分区装在移动硬盘上了</title>
		<link>http://www.neocanable.com/2011-08-26/</link>
		<comments>http://www.neocanable.com/2011-08-26/#comments</comments>
		<pubDate>Fri, 26 Aug 2011 14:22:38 +0000</pubDate>
		<dc:creator>Neo</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[小生活]]></category>

		<guid isPermaLink="false">http://www.neocanable.com/?p=373</guid>
		<description><![CDATA[今天也犯了个很2得错误，装centos得时候用硬盘安装得，安装得时候忘记了引导分区得设置，将系统得引导分区装在了移动硬盘上 悲惨得事情发生了，我得硬盘识别不了了，只能当电脑得引导盘用了～～～～ 我们能不能再2一点儿！！！！！！ 解决得办法还没找到，你妹，老子得移动硬盘. TODO-LIST： 1.j2EE的页面缓存要学着做一下，今天有人问到！ 2.找到centos移动硬盘安装的解决办法，fck]]></description>
			<content:encoded><![CDATA[<p>今天也犯了个很2得错误，装centos得时候用硬盘安装得，安装得时候忘记了引导分区得设置，将系统得引导分区装在了移动硬盘上<br />
悲惨得事情发生了，我得硬盘识别不了了，只能当电脑得引导盘用了～～～～</p>
<p>我们能不能再2一点儿！！！！！！</p>
<p>解决得办法还没找到，你妹，老子得移动硬盘.</p>
<p>TODO-LIST：<br />
1.j2EE的页面缓存要学着做一下，今天有人问到！<br />
2.找到centos移动硬盘安装的解决办法，fck</p>
]]></content:encoded>
			<wfw:commentRss>http://www.neocanable.com/2011-08-26/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>linux top 使用方法</title>
		<link>http://www.neocanable.com/linux-top/</link>
		<comments>http://www.neocanable.com/linux-top/#comments</comments>
		<pubDate>Sun, 20 Mar 2011 15:37:50 +0000</pubDate>
		<dc:creator>Neo</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[系统管理]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.neocanable.com/?p=294</guid>
		<description><![CDATA[LINUX性能监控工具 1.top各个列的含义 最顶行:三个数值分别为 1分钟、5分钟、15分钟前到现在的平均值。 a PID 进程id &#160; b PPID 父进程id &#160; c RUSER Real user name &#160; d UID 进程所有者的用户id &#160; e USER 进程所有者的用户名 &#160; f GROUP 进程所有者的组名 &#160; g TTY 启动进程的终端名。不是从终端启动的进程则显示为 ? &#160; h PR 优先级 &#160; i NI nice值。负值表示高优先级，正值表示低优先级 &#160; j P 最后使用的CPU，仅在多CPU环境下有意义 &#160; k %CPU 上次更新到现在的CPU时间占用百分比 &#160; l TIME 进程使用的CPU时间总计，单位秒 &#160; [...]]]></description>
			<content:encoded><![CDATA[<p>LINUX性能监控工具</p>
<p>1.top各个列的含义</p>
<p>      最顶行:三个数值分别为 1分钟、5分钟、15分钟前到现在的平均值。</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">a PID 进程<span style="color: #c20cb9; font-weight: bold;">id</span> &nbsp;<br />
b PPID 父进程<span style="color: #c20cb9; font-weight: bold;">id</span> &nbsp;<br />
c RUSER Real user name &nbsp;<br />
d UID 进程所有者的用户<span style="color: #c20cb9; font-weight: bold;">id</span> &nbsp;<br />
e USER 进程所有者的用户名 &nbsp;<br />
f GROUP 进程所有者的组名 &nbsp;<br />
g TTY 启动进程的终端名。不是从终端启动的进程则显示为 ? &nbsp;<br />
h PR 优先级 &nbsp;<br />
i NI <span style="color: #c20cb9; font-weight: bold;">nice</span>值。负值表示高优先级，正值表示低优先级 &nbsp;<br />
j P 最后使用的CPU，仅在多CPU环境下有意义 &nbsp;<br />
k <span style="color: #000000; font-weight: bold;">%</span>CPU 上次更新到现在的CPU时间占用百分比 &nbsp;<br />
l TIME 进程使用的CPU时间总计，单位秒 &nbsp;<br />
m TIME+ 进程使用的CPU时间总计，单位<span style="color: #000000;">1</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">100</span>秒 &nbsp;<br />
n <span style="color: #000000; font-weight: bold;">%</span>MEM 进程使用的物理内存百分比 &nbsp;<br />
o VIRT 进程使用的虚拟内存总量，单位kb。<span style="color: #007800;">VIRT</span>=SWAP+RES &nbsp;<br />
p SWAP 进程使用的虚拟内存中，被换出的大小，单位kb。 &nbsp;<br />
q RES 进程使用的、未被换出的物理内存大小，单位kb。<span style="color: #007800;">RES</span>=CODE+DATA &nbsp;<br />
r CODE 可执行代码占用的物理内存大小，单位kb &nbsp;<br />
s DATA 可执行代码以外的部分<span style="color: #7a0874; font-weight: bold;">&#40;</span>数据段+栈<span style="color: #7a0874; font-weight: bold;">&#41;</span>占用的物理内存大小，单位kb &nbsp;<br />
t SHR 共享内存大小，单位kb &nbsp;<br />
u nFLT 页面错误次数 &nbsp;<br />
v nDRT 最后一次写入到现在，被修改过的页面数。 &nbsp;<br />
<span style="color: #c20cb9; font-weight: bold;">w</span> S 进程状态。 <br />
<span style="color: #007800;">D</span>=不可中断的睡眠状态 <br />
<span style="color: #007800;">R</span>=运行 <br />
<span style="color: #007800;">S</span>=睡眠 <br />
<span style="color: #007800;">T</span>=跟踪<span style="color: #000000; font-weight: bold;">/</span>停止 <br />
<span style="color: #007800;">Z</span>=僵尸进程 &nbsp;<br />
x COMMAND 命令名<span style="color: #000000; font-weight: bold;">/</span>命令行 &nbsp;<br />
y WCHAN 若该进程在睡眠，则显示睡眠中的系统函数名</div></div>
<p>2.交互式</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">t : cpu和任务数量的总结性信息是否显示<br />
m : 是否显示内存的使用情况<br />
A : 分屏,可以分四个屏,用来监控不同的参数<br />
&nbsp; &nbsp; -或者<span style="color: #ff0000;">&quot;_&quot;</span> : 否显示当前窗口和是否显示所有<br />
&nbsp; &nbsp; G : 选择操作的窗口<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <br />
<br />
z : 关闭颜色显示<br />
Z : 设置颜色,<span style="color: #000000;">0</span>-<span style="color: #000000;">7</span><br />
B : 使用加粗显示<br />
b : 配合x,y使用，能公将当前排序列加粗<br />
f : 设置需要选择的那些列<br />
o : 设置列的显示顺序,例如地一列显示内存的使用，第二列显示cpu的使用<br />
&nbsp; &nbsp; &nbsp;.... <span style="color: #7a0874; font-weight: bold;">shift</span>+字母<span style="color: #000000; font-weight: bold;">/</span>字母调整顺序<br />
<br />
F<span style="color: #000000; font-weight: bold;">/</span>O : 设置排序的列<br />
<br />
R : 将结果倒排序<span style="color: #7a0874; font-weight: bold;">&#40;</span>reverse<span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
c : 显示进程是用什么命令运行的<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">command</span> line<span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
i : 空闲的任务<br />
u : 设置显示某个用户的进程,什么都不填是所有用户的<br />
n 或者 <span style="color: #666666; font-style: italic;"># : 设置显示的进程数量,0是不限 </span><br />
k : 杀死某个进程，需要给出进程的<span style="color: #c20cb9; font-weight: bold;">id</span><br />
r : <span style="color: #c20cb9; font-weight: bold;">nice</span>和renice<br />
W : 写到配置文件中 <br />
l : 是否显示load average<br />
s : 改变刷屏的时间间隔<br />
<span style="color: #000000; font-weight: bold;">&lt;</span>或者<span style="color: #000000; font-weight: bold;">&gt;</span> : 替换排序的列</div></div>
<p>3 运行参数</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp; &nbsp;<span style="color: #660033;">-d</span> 设置刷屏的时间 &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;"># top -d 2</span><br />
&nbsp; &nbsp;<span style="color: #660033;">-p</span> 指定需要监控的进程<span style="color: #c20cb9; font-weight: bold;">id</span> &nbsp; <span style="color: #666666; font-style: italic;"># top -p 1122</span><br />
&nbsp; &nbsp;<span style="color: #660033;">-s</span> 安全模式，这个不太懂<br />
&nbsp; &nbsp;<span style="color: #660033;">-i</span> 不显示闲置和僵死的进程<br />
&nbsp; &nbsp;<span style="color: #660033;">-c</span> 显示全部命令参数</div></div>
]]></content:encoded>
			<wfw:commentRss>http://www.neocanable.com/linux-top/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>linux ssh</title>
		<link>http://www.neocanable.com/linux-ssh/</link>
		<comments>http://www.neocanable.com/linux-ssh/#comments</comments>
		<pubDate>Sun, 20 Mar 2011 15:33:52 +0000</pubDate>
		<dc:creator>Neo</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[系统管理]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.neocanable.com/?p=291</guid>
		<description><![CDATA[1.ssh -l username remoteip 或者 ssh username@remoteip ssh -l meng -p 22 192.168.254.50 ssh默认的端口是22，所以remote address的ssh server 如果没有修改ssh的端口的话会默认为22 neo@ubuntu:~$ ssh -l meng 192.168.254.50 Last login: Fri Mar 11 12:14:48 2011 from 192.168.254.102 [meng@ddkan ~]$ 2.ssh server绑定ip地址 ListenAddress 192.168.0.11 # 只允许192.168.0.11这个ip登录上来 3.修改ssh端口 Port 2222 修改ssh服务的端口为2222 4.修改ssh协议的版本 Protocol 2 # 可以为1和2这两个版本 5.不允许root登录 PermitRootLogin no 详细：http://blog.lizhigang.net/archives/249]]></description>
			<content:encoded><![CDATA[<p>1.ssh -l username remoteip 或者 ssh username@remoteip<br />
 ssh -l meng -p 22 192.168.254.50<br />
 ssh默认的端口是22，所以remote address的ssh server 如果没有修改ssh的端口的话会默认为22<br />
neo@ubuntu:~$ ssh -l meng 192.168.254.50<br />
Last login: Fri Mar 11 12:14:48 2011 from 192.168.254.102<br />
[meng@ddkan ~]$ </p>
<p>2.ssh server绑定ip地址<br />
ListenAddress 192.168.0.11 # 只允许192.168.0.11这个ip登录上来</p>
<p>3.修改ssh端口<br />
Port 2222 修改ssh服务的端口为2222</p>
<p>4.修改ssh协议的版本<br />
Protocol 2  # 可以为1和2这两个版本</p>
<p>5.不允许root登录<br />
PermitRootLogin no</p>
<p>详细：<a href="http://blog.lizhigang.net/archives/249">http://blog.lizhigang.net/archives/249</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.neocanable.com/linux-ssh/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>linux tar 打包方法</title>
		<link>http://www.neocanable.com/linux-tar/</link>
		<comments>http://www.neocanable.com/linux-tar/#comments</comments>
		<pubDate>Sun, 20 Mar 2011 15:32:24 +0000</pubDate>
		<dc:creator>Neo</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[系统管理]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.neocanable.com/?p=288</guid>
		<description><![CDATA[1.创建tar包 tar cvf demo.tar demo/ # 打包 tar xvf demo.tar &#160; &#160; &#160; # 解包 c : 创建归档文件 v : 显示被打包的文件 f : 使用文件归档 tar czvf demo.tar.gz demo/ # 打包并且压缩 tar xzvf demo.tar.gz &#160; &#160; &#160; # 解压缩 z : 压缩，用gzip note: tgz == tar.gz tar cjvf demo.tar.bz2 demo/ # 用gzip2压缩 tar xjvf demo.tar.bz2 &#160; [...]]]></description>
			<content:encoded><![CDATA[<p>1.创建tar包</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">tar</span> cvf demo.tar demo<span style="color: #000000; font-weight: bold;">/</span> <span style="color: #666666; font-style: italic;"># 打包</span><br />
<span style="color: #c20cb9; font-weight: bold;">tar</span> xvf demo.tar &nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;"># 解包</span></div></div>
<p>c : 创建归档文件<br />
v : 显示被打包的文件<br />
f : 使用文件归档</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">tar</span> czvf demo.tar.gz demo<span style="color: #000000; font-weight: bold;">/</span> <span style="color: #666666; font-style: italic;"># 打包并且压缩</span><br />
<span style="color: #c20cb9; font-weight: bold;">tar</span> xzvf demo.tar.gz &nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;"># 解压缩</span></div></div>
<p>z : 压缩，用gzip<br />
note: tgz == tar.gz</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">tar</span> cjvf demo.tar.bz2 demo<span style="color: #000000; font-weight: bold;">/</span> <span style="color: #666666; font-style: italic;"># 用gzip2压缩</span><br />
<span style="color: #c20cb9; font-weight: bold;">tar</span> xjvf demo.tar.bz2 &nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;"># 解压</span></div></div>
<p>j : bzip2解压<br />
note: tbz和.tb2 等同于tar.bz2</p>
<p>2.查看tar包里面的东西(listing a tar file)</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">tar</span> tvf demo.tar &nbsp; &nbsp; <span style="color: #666666; font-style: italic;"># 查看一个tar文件</span><br />
<span style="color: #c20cb9; font-weight: bold;">tar</span> tzvf demo.tar.gz <span style="color: #666666; font-style: italic;"># 查看tar.gz/tgz文件</span><br />
<span style="color: #c20cb9; font-weight: bold;">tar</span> tjvf demo.tar.bz2 <span style="color: #666666; font-style: italic;"># 查看bz2/tb2/tbz等类型的文件</span></div></div>
<p>3.解压单独文件或者目录</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">tar</span> xvf demo.tar .<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">file</span> &nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;"># 将file从demo.tar中解压出来</span><br />
<span style="color: #c20cb9; font-weight: bold;">tar</span> xzvf demo.tar.gz .<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">file</span> &nbsp; <span style="color: #666666; font-style: italic;"># 将file从demo.tar.gz中解压出来</span><br />
<span style="color: #c20cb9; font-weight: bold;">tar</span> xjvf demo.tar.bz2 .<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">file</span> &nbsp;<span style="color: #666666; font-style: italic;"># 将file从demo.tar.bz2中解压出来</span></div></div>
<p>5.解压出一种类型的文件</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">tar</span> xvf demo.tar <span style="color: #660033;">--wildcards</span> ‘<span style="color: #000000; font-weight: bold;">*</span>.rb’ <span style="color: #666666; font-style: italic;"># 解压demo.tar包中所有的rb文件</span></div></div>
<p>6.将文件或者目录推到tar里面</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">tar</span> rvf demo.tar demo<span style="color: #000000; font-weight: bold;">/</span> &nbsp; &nbsp; <span style="color: #666666; font-style: italic;"># 将demo/ 目录打包到demo.tar中</span><br />
<span style="color: #c20cb9; font-weight: bold;">tar</span> rvf demo.tar demo.file <span style="color: #666666; font-style: italic;"># 将demo.file打包到demo.tar中</span></div></div>
<p>other tips</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">tar</span> cjvf back-$<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">date</span> +<span style="color: #000000; font-weight: bold;">%</span>Y<span style="color: #000000; font-weight: bold;">%</span>m<span style="color: #000000; font-weight: bold;">%</span>d<span style="color: #7a0874; font-weight: bold;">&#41;</span>.tar.bz2 to_backup<span style="color: #000000; font-weight: bold;">/</span> <span style="color: #666666; font-style: italic;"># 按照日期备份</span></div></div>
]]></content:encoded>
			<wfw:commentRss>http://www.neocanable.com/linux-tar/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>linux grep 使用方法</title>
		<link>http://www.neocanable.com/linux-grep/</link>
		<comments>http://www.neocanable.com/linux-grep/#comments</comments>
		<pubDate>Sun, 20 Mar 2011 15:29:54 +0000</pubDate>
		<dc:creator>Neo</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[系统管理]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.neocanable.com/?p=285</guid>
		<description><![CDATA[1.在一个文件内搜索某个字符串 grep 'match_word' file 2.在多个文件内搜索某个字符串 grep 'match_word' file file2 grep 'match_word' *.rb &#160; &#160; &#160;# 后面可以跟正则\ 3.不区分大小写 grep -i 'match_word' file 4.正则表达式 grep 'regular' file &#160;# 放一个正则表达式也是ok的 5.全字匹配 grep -w 'the' file &#160; # 会匹配the，但是不会匹配there 6.匹配前后几行(match with A/B/C) grep -A 3 'the' file # 匹配出现the的那行并且也输出后面的三行 grep -B 3 'the' file # 匹配出现the的那行并且也输出前面的三行 grep -C 3 [...]]]></description>
			<content:encoded><![CDATA[<p>1.在一个文件内搜索某个字符串</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #ff0000;">'match_word'</span> <span style="color: #c20cb9; font-weight: bold;">file</span></div></div>
<p>2.在多个文件内搜索某个字符串</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #ff0000;">'match_word'</span> <span style="color: #c20cb9; font-weight: bold;">file</span> file2<br />
<span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #ff0000;">'match_word'</span> <span style="color: #000000; font-weight: bold;">*</span>.rb &nbsp; &nbsp; &nbsp;<span style="color: #666666; font-style: italic;"># 后面可以跟正则\</span></div></div>
<p>3.不区分大小写</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #660033;">-i</span> <span style="color: #ff0000;">'match_word'</span> <span style="color: #c20cb9; font-weight: bold;">file</span></div></div>
<p>4.正则表达式</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #ff0000;">'regular'</span> <span style="color: #c20cb9; font-weight: bold;">file</span> &nbsp;<span style="color: #666666; font-style: italic;"># 放一个正则表达式也是ok的</span></div></div>
<p>5.全字匹配</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #660033;">-w</span> <span style="color: #ff0000;">'the'</span> <span style="color: #c20cb9; font-weight: bold;">file</span> &nbsp; <span style="color: #666666; font-style: italic;"># 会匹配the，但是不会匹配there</span></div></div>
<p>6.匹配前后几行(match with A/B/C)</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #660033;">-A</span> <span style="color: #000000;">3</span> <span style="color: #ff0000;">'the'</span> <span style="color: #c20cb9; font-weight: bold;">file</span> <span style="color: #666666; font-style: italic;"># 匹配出现the的那行并且也输出后面的三行</span><br />
<span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #660033;">-B</span> <span style="color: #000000;">3</span> <span style="color: #ff0000;">'the'</span> <span style="color: #c20cb9; font-weight: bold;">file</span> <span style="color: #666666; font-style: italic;"># 匹配出现the的那行并且也输出前面的三行</span><br />
<span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #660033;">-C</span> <span style="color: #000000;">3</span> <span style="color: #ff0000;">'the'</span> <span style="color: #c20cb9; font-weight: bold;">file</span> <span style="color: #666666; font-style: italic;"># 匹配出现the的那行并且也输出前后三行</span></div></div>
<p>7.搜索目录下的文件</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #660033;">-r</span> <span style="color: #ff0000;">'the'</span> .<span style="color: #000000; font-weight: bold;">/</span> &nbsp;<span style="color: #666666; font-style: italic;"># 搜索目录下面的文件里面报行the的文件</span><br />
<span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #660033;">-R</span> <span style="color: #ff0000;">'the'</span> .<span style="color: #000000; font-weight: bold;">/</span> &nbsp;<span style="color: #666666; font-style: italic;"># 递归搜索</span></div></div>
<p>8.反向匹配</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #660033;">-v</span> <span style="color: #ff0000;">'the'</span> <span style="color: #c20cb9; font-weight: bold;">file</span> <span style="color: #666666; font-style: italic;"># 找不不含有the的行</span></div></div>
<p>9.反向匹配多个字符</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #660033;">-v</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'the'</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'this'</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'find'</span> <span style="color: #666666; font-style: italic;"># 匹配不包含the、this、find的行</span></div></div>
<p>10.找到匹配的数量</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #660033;">-c</span> <span style="color: #ff0000;">'the'</span> <span style="color: #c20cb9; font-weight: bold;">file</span> <span style="color: #666666; font-style: italic;"># 找出字符the的行数的数量</span></div></div>
<p>11.显示匹配的的行号</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #660033;">-n</span> <span style="color: #ff0000;">'the'</span> <span style="color: #c20cb9; font-weight: bold;">file</span> <span style="color: #666666; font-style: italic;"># 找出file内匹配the的行，并且显示行号</span></div></div>
<p>12.仅仅显示匹配的文件名称</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #660033;">-l</span> <span style="color: #ff0000;">'the'</span> <span style="color: #000000; font-weight: bold;">*</span>.rb &nbsp;<span style="color: #666666; font-style: italic;"># 所有包含字符the的文件名称</span></div></div>
<p>13.仅仅显示匹配的字符串</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #660033;">-o</span> <span style="color: #ff0000;">'the'</span> <span style="color: #c20cb9; font-weight: bold;">file</span> &nbsp;<span style="color: #666666; font-style: italic;"># &nbsp;仅仅显示每行的the</span></div></div>
<p>14.多颜色显示</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #660033;">-v</span> <span style="color: #ff0000;">'the'</span> <span style="color: #c20cb9; font-weight: bold;">file</span> <span style="color: #660033;">--color</span></div></div>
<p>或者</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">GREP_OPTIONS</span>=<span style="color: #ff0000;">'--color=auto'</span> <span style="color: #007800;">GREP_COLOR</span>=<span style="color: #ff0000;">'100;8'</span> ; <br />
<span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #ff0000;">'the'</span> <span style="color: #c20cb9; font-weight: bold;">file</span></div></div>
]]></content:encoded>
			<wfw:commentRss>http://www.neocanable.com/linux-grep/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>linux find 使用方法</title>
		<link>http://www.neocanable.com/linux-find/</link>
		<comments>http://www.neocanable.com/linux-find/#comments</comments>
		<pubDate>Sun, 20 Mar 2011 15:26:39 +0000</pubDate>
		<dc:creator>Neo</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.neocanable.com/?p=281</guid>
		<description><![CDATA[1.找到某个名字的文件 find -name 'demo.rb' # 找到名字是demo.rb的文件(当前目录下递归查找) find -name '*.svn' &#160; # 后面也能跟正则表达式 2.大小写不敏感 find -iname 'demo.rb' # 不区分大小写的找demo.rb这个文件名字,DEmo.rb也匹配 3.指定最大/小递归的目录层数 # 在当前目录下面递归查找demo.rb，但是最深到第2层目录 find --maxdepth 2 -name 'demo.rb' # 最大递归目录层数3，最小2 find --mindepth 2 --maxdepth 3 -name 'demo.rb' 4.查找不匹配的，反向查找 find -not -name 'demo.rb' # 找到不是demo.rb的文件 5.用find的执行结果执行下个命令 # cat 所有名字报行demo.rb的文件 find -name 'demo.rb' --exec cat &#123;&#125; find -name 'demo.rb' [...]]]></description>
			<content:encoded><![CDATA[<p>1.找到某个名字的文件</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">find</span> <span style="color: #660033;">-name</span> <span style="color: #ff0000;">'demo.rb'</span> <span style="color: #666666; font-style: italic;"># 找到名字是demo.rb的文件(当前目录下递归查找)</span><br />
<span style="color: #c20cb9; font-weight: bold;">find</span> <span style="color: #660033;">-name</span> <span style="color: #ff0000;">'*.svn'</span> &nbsp; <span style="color: #666666; font-style: italic;"># 后面也能跟正则表达式</span></div></div>
<p>2.大小写不敏感</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">find</span> <span style="color: #660033;">-iname</span> <span style="color: #ff0000;">'demo.rb'</span> <span style="color: #666666; font-style: italic;"># 不区分大小写的找demo.rb这个文件名字,DEmo.rb也匹配</span></div></div>
<p>3.指定最大/小递归的目录层数<br />
# 在当前目录下面递归查找demo.rb，但是最深到第2层目录</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">find</span> <span style="color: #660033;">--maxdepth</span> <span style="color: #000000;">2</span> <span style="color: #660033;">-name</span> <span style="color: #ff0000;">'demo.rb'</span></div></div>
<p># 最大递归目录层数3，最小2</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">find</span> <span style="color: #660033;">--mindepth</span> <span style="color: #000000;">2</span> <span style="color: #660033;">--maxdepth</span> <span style="color: #000000;">3</span> <span style="color: #660033;">-name</span> <span style="color: #ff0000;">'demo.rb'</span></div></div>
<p>4.查找不匹配的，反向查找</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">find</span> <span style="color: #660033;">-not</span> <span style="color: #660033;">-name</span> <span style="color: #ff0000;">'demo.rb'</span> <span style="color: #666666; font-style: italic;"># 找到不是demo.rb的文件</span></div></div>
<p>5.用find的执行结果执行下个命令</p>
<p># cat 所有名字报行demo.rb的文件</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">find</span> <span style="color: #660033;">-name</span> <span style="color: #ff0000;">'demo.rb'</span> <span style="color: #660033;">--exec</span> <span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span><span style="color: #7a0874; font-weight: bold;">&#125;</span><br />
<span style="color: #c20cb9; font-weight: bold;">find</span> <span style="color: #660033;">-name</span> <span style="color: #ff0000;">'demo.rb'</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">xargs</span> <span style="color: #c20cb9; font-weight: bold;">cat</span></div></div>
<p>6.查找空文件</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">find</span> .<span style="color: #000000; font-weight: bold;">/</span> <span style="color: #660033;">-empty</span> <span style="color: #666666; font-style: italic;"># 找当前目录下的空文件</span></div></div>
<p>7.根据文件类型查找</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">find</span> . <span style="color: #660033;">-type</span> s <span style="color: #666666; font-style: italic;"># 查找socket文件</span><br />
<span style="color: #c20cb9; font-weight: bold;">find</span> . <span style="color: #660033;">-type</span> d <span style="color: #666666; font-style: italic;"># 查找目录</span><br />
<span style="color: #c20cb9; font-weight: bold;">find</span> . <span style="color: #660033;">-type</span> f <span style="color: #666666; font-style: italic;"># 普通文件</span><br />
<span style="color: #c20cb9; font-weight: bold;">find</span> . <span style="color: #660033;">-type</span> f <span style="color: #660033;">-name</span> <span style="color: #ff0000;">&quot;.*&quot;</span> <span style="color: #666666; font-style: italic;"># 隐藏文件</span><br />
<span style="color: #c20cb9; font-weight: bold;">find</span> <span style="color: #660033;">-type</span> d <span style="color: #660033;">-name</span> <span style="color: #ff0000;">&quot;.*&quot;</span> <span style="color: #666666; font-style: italic;"># 隐藏目录</span></div></div>
<p>8.根据文件大小搜索</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">find</span> .<span style="color: #000000; font-weight: bold;">/</span> <span style="color: #660033;">-size</span> +100M <span style="color: #666666; font-style: italic;"># 找出大于100M的文件</span><br />
<span style="color: #c20cb9; font-weight: bold;">find</span> .<span style="color: #000000; font-weight: bold;">/</span> <span style="color: #660033;">-size</span> <span style="color: #660033;">-100M</span> <span style="color: #666666; font-style: italic;"># 找出小于100M的文件</span><br />
<span style="color: #c20cb9; font-weight: bold;">find</span> .<span style="color: #000000; font-weight: bold;">/</span> <span style="color: #660033;">-size</span> 100M &nbsp;<span style="color: #666666; font-style: italic;"># 找出等于100M的文件</span></div></div>
<p>9.根据修改时间查找</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">find</span> <span style="color: #660033;">-mtime</span> <span style="color: #000000;">5</span> &nbsp;<span style="color: #666666; font-style: italic;"># 找出5天之前修改的文件</span><br />
<span style="color: #c20cb9; font-weight: bold;">find</span> <span style="color: #660033;">-mmin</span> <span style="color: #000000;">5</span> &nbsp; <span style="color: #666666; font-style: italic;"># 找出5分钟之前修改的文件</span><br />
<br />
<span style="color: #c20cb9; font-weight: bold;">find</span> <span style="color: #660033;">-atiem</span> <span style="color: #000000;">5</span> &nbsp;<span style="color: #666666; font-style: italic;"># 5天之内修改过的文件</span><br />
<span style="color: #c20cb9; font-weight: bold;">find</span> <span style="color: #660033;">-amin</span> &nbsp;<span style="color: #000000;">5</span> &nbsp;<span style="color: #666666; font-style: italic;"># 5分钟内修改过的文件</span></div></div>
]]></content:encoded>
			<wfw:commentRss>http://www.neocanable.com/linux-find/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

