<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[阿Tim日志]]></title> 
<link>https://atim.cn/index.php</link> 
<description><![CDATA[专业的php开发者.开发团队的带队人]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[阿Tim日志]]></copyright>
<item>
<link>https://atim.cn/post/1049/</link>
<title><![CDATA[linux uniq 命令]]></title> 
<author>bkkkd &lt;partybase@gmail.com&gt;</author>
<category><![CDATA[linux/unix 命令解释]]></category>
<pubDate>Sun, 20 May 2012 05:22:47 +0000</pubDate> 
<guid>https://atim.cn/post/1049/</guid> 
<description>
<![CDATA[ 
	用途<br/><br/>报告或删除文件中重复的行。<br/><br/>语法<br/><div class="code">uniq &#91;&nbsp;&nbsp;-c &#124; -d &#124; -u &#93; &#91;&nbsp;&nbsp;-f Fields &#93; &#91;&nbsp;&nbsp;-s Characters &#93; &#91;&nbsp;&nbsp;-Fields &#93; &#91; +Characters &#93; &#91; InFile &#91; OutFile &#93; &#93;</div><br/>描述<br/><br/>uniq 命令删除文件中的重复行。 uniq 命令读取由 InFile 参数指定的标准输入或文件。该命令首先比较相邻的行，然后除去第二行和该行的后续副本。重复的行一定相邻。（在发出 uniq 命令之前，请使用 sort 命令使所有重复行相邻。）最后，uniq 命令将最终单独的行写入标准输出或由 OutFile 参数指定的文件。InFile 和 OutFile 参数必须指定不同的文件。<br/><br/>输入文件必须是文本文件。文本文件是包含组织在一行或多行中的字符的文件。这些行的长度不能超出 2048 个字节（包含所有换行字符），并且其中不能包含空字符。<br/><br/>缺省情况下，uniq 命令比较所有行。如果指定了-f Fields 或 -Fields 标志, uniq 命令忽略由 Fields 变量指定的字段数目。 field 是一个字符串，用一个或多个 <空格 > 字符将它与其它字符串分隔开。如果指定了 -s Characters 或 -Characters 标志, uniq 命令忽略由 Characters 变量指定的字段数目。 为 Fields 和 Characters 变量指定的值必须是正的十进制整数。<br/><br/>当前本地语言环境决定了 -f 标志使用的 <空白> 字符以及 -s 标志如何将字节解释成字符。<br/><br/>如果执行成功，uniq 命令退出，返回值 0。否则，命令退出返回值大于 0。<br/><br/>标志<br/><br/>-c&nbsp;&nbsp; 在输出行前面加上每行在输入文件中出现的次数。<br/>-d&nbsp;&nbsp; 仅显示重复行。<br/>-f Fields&nbsp;&nbsp; 忽略由 Fields 变量指定的字段数目。 如果 Fields 变量的值 超过输入行中的字段数目, uniq 命令用空字符串进行比较。 这个标志和 -Fields 标志是等价的。<br/>-u&nbsp;&nbsp; 仅显示不重复的行。<br/>-s Characters&nbsp;&nbsp; 忽略由 Characters 变量指定的字符的数目。 如果 Characters 变量的值超过输入行中的字符的数目, uniq 用空字符串进行比较。 如果同时指定 -f 和 -s 标志, uniq 命令忽略由 -s Characters 标志指定的字符的数目，而从由 -f Fields 标志指定的字段后开始。 这个标志和 +Characters 标志是等价的。<br/>-Fields&nbsp;&nbsp; 忽略由 Fields 变量指定的字段数目。 这个标志和 -f Fields 标志是等价的。<br/>+Characters&nbsp;&nbsp; 忽略由 Characters 变量指定的字符的数目。 如果同时指定 - Fields 和 +Characters 标志, uniq 命令忽略由 +Characters 标志指定的字符数目，并从由 -Fields 标志指定的字段后开始。 这个标志和 -s Characters 标志是等价的。<br/>退出状态<br/><br/>该命令返回以下退出值：<br/><br/>0&nbsp;&nbsp; 命令运行成功。<br/>>0&nbsp;&nbsp; 发生错误。<br/>示例<br/><br/>要删除名为 fruit 文件中的重复行并将其保存到一个名为 newfruit 的文件中， 输入：<br/><div class="code"> uniq fruit newfruit</div><br/>如果 fruit 文件包含下列行:<br/><br/><div class="code">apples<br/>apples<br/>peaches<br/>pears<br/>bananas<br/>cherries<br/>cherries</div><br/>则在您运行uniq 命令后 newfruit 文件将包含下列行:<br/><br/><div class="code">apples<br/>peaches<br/>pears<br/>bananas<br/>cherries</div><br/>Tags - <a href="https://atim.cn/tags/linux/" rel="tag">linux</a> , <a href="https://atim.cn/tags/%25E5%2591%25BD%25E4%25BB%25A4/" rel="tag">命令</a>
]]>
</description>
</item><item>
<link>https://atim.cn/post/1049/#blogcomment5318</link>
<title><![CDATA[[评论] linux uniq 命令]]></title> 
<author>阿杨 &lt;man110120@qq.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Tue, 10 Jul 2012 06:52:06 +0000</pubDate> 
<guid>https://atim.cn/post/1049/#blogcomment5318</guid> 
<description>
<![CDATA[ 
	你去年放pw的windows vps cpu占用率100%解决了吗?
]]>
</description>
</item><item>
<link>https://atim.cn/post/1049/#blogcomment5320</link>
<title><![CDATA[[评论] linux uniq 命令]]></title> 
<author>ixwebhosting &lt;wwm910@sohu.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Fri, 20 Jul 2012 07:30:38 +0000</pubDate> 
<guid>https://atim.cn/post/1049/#blogcomment5320</guid> 
<description>
<![CDATA[ 
	看起来好专业的
]]>
</description>
</item>
</channel>
</rss>