<?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>删除 &#8211; 编码无悔 /  Intent &amp; Focused</title>
	<atom:link href="https://www.codelast.com/tag/%E5%88%A0%E9%99%A4/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.codelast.com</link>
	<description>最优化之路</description>
	<lastBuildDate>Sun, 03 May 2020 12:57:24 +0000</lastBuildDate>
	<language>zh-Hans</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>
	<item>
		<title>用shell删除一个文件的前N行</title>
		<link>https://www.codelast.com/%e7%94%a8shell%e5%88%a0%e9%99%a4%e4%b8%80%e4%b8%aa%e6%96%87%e4%bb%b6%e7%9a%84%e5%89%8dn%e8%a1%8c/</link>
					<comments>https://www.codelast.com/%e7%94%a8shell%e5%88%a0%e9%99%a4%e4%b8%80%e4%b8%aa%e6%96%87%e4%bb%b6%e7%9a%84%e5%89%8dn%e8%a1%8c/#respond</comments>
		
		<dc:creator><![CDATA[learnhard]]></dc:creator>
		<pubDate>Mon, 25 Oct 2010 05:32:33 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[原创]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[删除]]></category>
		<category><![CDATA[前N行]]></category>
		<category><![CDATA[前几行]]></category>
		<category><![CDATA[文件]]></category>
		<guid isPermaLink="false">http://www.codelast.com/?p=780</guid>

					<description><![CDATA[<p>
	<span style="font-size:14px;">假设你想删除一个文本文件的前N行，并且你不想先将后面要保留的内容先保存到其他临时文件中，那么可以在shell中这样写（此处假设要删除的是 /root/file.txt 的前10行）：</span></p>
<p>
<span id="more-780"></span></p>
<p>
	<span style="color:#00f;"><span style="font-size:14px;">ex /root/file.txt &#60;&#60; EOF</span></span></p>
<p>
	<span style="color:#00f;"><span style="font-size:14px;">1,10d</span></span></p>
<p>
	<span style="color:#00f;"><span style="font-size:14px;">wq</span></span></p>
<p>
	<span style="color:#00f;"><span style="font-size:14px;">EOF</span></span></p>
<p>
	&#160;</p>
<p>
	<span style="font-size:14px;">注意第二行的写法：<span style="color:#00f;">1,10d</span> 表示删除第1到第10行。同理，你要删除第3到第7行，可以写成 3,7d ，依此类推。</span></p>
<p>
	&#160;</p>
<p>
	<span style="font-size:14px;">这种方法倒是有一个弊端：当<span style="color:#f00;">你的文件行数&#160;</span>&#60;&#160;<span style="color:#f00;">要删除的行数</span>时（此处所说的&#8220;你的文件行数&#8221;不包括文件的最后一个空行，即：如果你的文件最后一行是一个空行，那么么此处所说的&#8220;你的文件行数&#8221;就不包括它），那么用这种方法就会一行都删不掉（而不是我们想像中的&#8220;会删除文件中的所有行&#8221;）。</span></p>
<p>
	<span style="font-size:14px;">例如，你的文件内容为（5行+一个空行）：</span></p>
<p>
	<span style="color:#00f;">11</span></p>
<p>
	<span style="color:#00f;">22</span></p>
<p>
	<span style="color:#00f;">33</span></p>
<p>
	<span style="color:#00f;">44</span></p>
<p>
	<span style="color:#00f;">55</span></p>
<p>
	<span style="color:#00f;">（此处为一个空行，即：只有一个换行符 \n 的行）</span></p>
<p>
	&#160;</p>
<p>
	<span style="font-size:14px;">那么使用 1,6d 就会删除不掉任何内容，只有使用 1,5d 才能删除所有内容。</span></p>
<p>
	<br />
	<span style="color: rgb(255, 255, 255);">文章来源：</span><a href="https://www.codelast.com/" rel="noopener noreferrer" target="_blank"><span style="color: rgb(255, 255, 255);">https://www.codelast.com/</span></a><br />
	<span style="color: rgb(255, 0, 0);">➤➤</span>&#160;版权声明&#160;<span style="color: rgb(255, 0, 0);">➤➤</span>&#160;<br />
	转载需注明出处：<u><a href="https://www.codelast.com/" rel="noopener noreferrer" target="_blank"><em><span style="color: rgb(0, 0, 255);"><strong style="font-size: 16px;"><span style="font-family: arial, helvetica, sans-serif;">codelast.com</span></strong></span></em></a></u>&#8230; <a href="https://www.codelast.com/%e7%94%a8shell%e5%88%a0%e9%99%a4%e4%b8%80%e4%b8%aa%e6%96%87%e4%bb%b6%e7%9a%84%e5%89%8dn%e8%a1%8c/" class="read-more">Read More </a></p>]]></description>
										<content:encoded><![CDATA[<p>
	<span style="font-size:14px;">假设你想删除一个文本文件的前N行，并且你不想先将后面要保留的内容先保存到其他临时文件中，那么可以在shell中这样写（此处假设要删除的是 /root/file.txt 的前10行）：</span></p>
<p>
<span id="more-780"></span></p>
<p>
	<span style="color:#00f;"><span style="font-size:14px;">ex /root/file.txt &lt;&lt; EOF</span></span></p>
<p>
	<span style="color:#00f;"><span style="font-size:14px;">1,10d</span></span></p>
<p>
	<span style="color:#00f;"><span style="font-size:14px;">wq</span></span></p>
<p>
	<span style="color:#00f;"><span style="font-size:14px;">EOF</span></span></p>
<p>
	&nbsp;</p>
<p>
	<span style="font-size:14px;">注意第二行的写法：<span style="color:#00f;">1,10d</span> 表示删除第1到第10行。同理，你要删除第3到第7行，可以写成 3,7d ，依此类推。</span></p>
<p>
	&nbsp;</p>
<p>
	<span style="font-size:14px;">这种方法倒是有一个弊端：当<span style="color:#f00;">你的文件行数&nbsp;</span>&lt;&nbsp;<span style="color:#f00;">要删除的行数</span>时（此处所说的&ldquo;你的文件行数&rdquo;不包括文件的最后一个空行，即：如果你的文件最后一行是一个空行，那么么此处所说的&ldquo;你的文件行数&rdquo;就不包括它），那么用这种方法就会一行都删不掉（而不是我们想像中的&ldquo;会删除文件中的所有行&rdquo;）。</span></p>
<p>
	<span style="font-size:14px;">例如，你的文件内容为（5行+一个空行）：</span></p>
<p>
	<span style="color:#00f;">11</span></p>
<p>
	<span style="color:#00f;">22</span></p>
<p>
	<span style="color:#00f;">33</span></p>
<p>
	<span style="color:#00f;">44</span></p>
<p>
	<span style="color:#00f;">55</span></p>
<p>
	<span style="color:#00f;">（此处为一个空行，即：只有一个换行符 \n 的行）</span></p>
<p>
	&nbsp;</p>
<p>
	<span style="font-size:14px;">那么使用 1,6d 就会删除不掉任何内容，只有使用 1,5d 才能删除所有内容。</span></p>
<p>
	<br />
	<span style="color: rgb(255, 255, 255);">文章来源：</span><a href="https://www.codelast.com/" rel="noopener noreferrer" target="_blank"><span style="color: rgb(255, 255, 255);">https://www.codelast.com/</span></a><br />
	<span style="color: rgb(255, 0, 0);">➤➤</span>&nbsp;版权声明&nbsp;<span style="color: rgb(255, 0, 0);">➤➤</span>&nbsp;<br />
	转载需注明出处：<u><a href="https://www.codelast.com/" rel="noopener noreferrer" target="_blank"><em><span style="color: rgb(0, 0, 255);"><strong style="font-size: 16px;"><span style="font-family: arial, helvetica, sans-serif;">codelast.com</span></strong></span></em></a></u>&nbsp;<br />
	感谢关注我的微信公众号（微信扫一扫）：</p>
<p style="border: 0px; font-size: 13px; margin: 0px 0px 9px; outline: 0px; padding: 0px; color: rgb(77, 77, 77);">
	<img decoding="async" alt="wechat qrcode of codelast" src="https://www.codelast.com/codelast_wechat_qr_code.jpg" style="width: 200px; height: 200px;" /></p>
<p>
	<span style="color:#fff;">NULL</span></p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.codelast.com/%e7%94%a8shell%e5%88%a0%e9%99%a4%e4%b8%80%e4%b8%aa%e6%96%87%e4%bb%b6%e7%9a%84%e5%89%8dn%e8%a1%8c/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>[原创]在Linux下进行文件“粉碎”/擦除</title>
		<link>https://www.codelast.com/%e5%8e%9f%e5%88%9b%e5%9c%a8linux%e4%b8%8b%e8%bf%9b%e8%a1%8c%e6%96%87%e4%bb%b6%e2%80%9c%e7%b2%89%e7%a2%8e%e2%80%9d/</link>
					<comments>https://www.codelast.com/%e5%8e%9f%e5%88%9b%e5%9c%a8linux%e4%b8%8b%e8%bf%9b%e8%a1%8c%e6%96%87%e4%bb%b6%e2%80%9c%e7%b2%89%e7%a2%8e%e2%80%9d/#respond</comments>
		
		<dc:creator><![CDATA[learnhard]]></dc:creator>
		<pubDate>Tue, 14 Sep 2010 03:28:29 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[原创]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[wipe]]></category>
		<category><![CDATA[删除]]></category>
		<category><![CDATA[彻底]]></category>
		<category><![CDATA[文件]]></category>
		<category><![CDATA[粉碎]]></category>
		<guid isPermaLink="false">http://www.codelast.com/?p=165</guid>

					<description><![CDATA[<p>
	<span style="font-size:14px;"><span style="font-family:arial,helvetica,sans-serif;">文章来源：<a href="http://www.codelast.com/" style="padding-bottom: 0px; border-right-width: 0px; margin: 0px; padding-left: 0px; outline-width: 0px; padding-right: 0px; border-top-width: 0px; border-bottom-width: 0px; color: rgb(0,77,153); font-size: 14px; border-left-width: 0px; text-decoration: none; padding-top: 0px" target="_blank">http://www.codelast.com/</a></span></span></p>
<p>
	&#160;</p>
<p style="padding-bottom: 0px; border-right-width: 0px; margin: 0px 0px 9px; padding-left: 0px; outline-width: 0px; padding-right: 0px; border-top-width: 0px; border-bottom-width: 0px; color: rgb(77,77,77); font-size: 13px; border-left-width: 0px; padding-top: 0px">
	<span style="font-size:14px;"><span style="font-family:arial,helvetica,sans-serif;">众所周知Windows下的文件删除之后是有可能恢复的，对重要文件，为了增加恢复的难度，我们可以用文件粉碎工具进行文件粉碎。我最常用的是集成到资源管理器中的Eraser。那么在Linux下有没有类似的软件呢？我在一台只有Ubuntu系统的主机上，安装了一个文件粉碎工具wipe，有些想法，记下来。</span></span></p>
<p style="padding-bottom: 0px; border-right-width: 0px; margin: 0px 0px 9px; padding-left: 0px; outline-width: 0px; padding-right: 0px; border-top-width: 0px; border-bottom-width: 0px; color: rgb(77,77,77); font-size: 13px; border-left-width: 0px; padding-top: 0px">
	<span style="font-size:14px;"><span style="font-family:arial,helvetica,sans-serif;">安装：apt-get install wipe</span></span></p>
<p style="padding-bottom: 0px; border-right-width: 0px; margin: 0px 0px 9px; padding-left: 0px; outline-width: 0px; padding-right: 0px; border-top-width: 0px; border-bottom-width: 0px; color: rgb(77,77,77); font-size: 13px; border-left-width: 0px; padding-top: 0px">
	<span style="font-size:14px;"><span style="font-family:arial,helvetica,sans-serif;">wipe有没有GUI我不知道，命令行也不难用：</span></span></p>
<p style="padding-bottom: 0px; border-right-width: 0px; margin: 0px 0px 9px; padding-left: 0px; outline-width: 0px; padding-right: 0px; border-top-width: 0px; border-bottom-width: 0px; color: rgb(77,77,77); font-size: 13px; border-left-width: 0px; padding-top: 0px">
<span id="more-165"></span></p>
<p style="padding-bottom: 0px; border-right-width: 0px; margin: 0px 0px 9px; padding-left: 0px; outline-width: 0px; padding-right: 0px; border-top-width: 0px; border-bottom-width: 0px; color: rgb(77,77,77); font-size: 13px; border-left-width: 0px; padding-top: 0px">
	<span style="font-size:14px;"><span style="font-family:arial,helvetica,sans-serif;">粉碎一个文件：wipe 文件名</span></span></p>
<p style="padding-bottom: 0px; border-right-width: 0px; margin: 0px 0px 9px; padding-left: 0px; outline-width: 0px; padding-right: 0px; border-top-width: 0px; border-bottom-width: 0px; color: rgb(77,77,77); font-size: 13px; border-left-width: 0px; padding-top: 0px">
	<span style="font-size:14px;"><span style="font-family:arial,helvetica,sans-serif;">粉碎一个文件夹：wipe -rf 文件夹名</span></span></p>
<p style="padding-bottom: 0px; border-right-width: 0px; margin: 0px 0px 9px; padding-left: 0px; outline-width: 0px; padding-right: 0px; border-top-width: 0px; border-bottom-width: 0px; color: rgb(77,77,77); font-size: 13px; border-left-width: 0px; padding-top: 0px">
	<span style="font-size:14px;"><span style="font-family:arial,helvetica,sans-serif;">（更多用法，请参考 wipe -h）</span></span></p>
<p style="padding-bottom: 0px; border-right-width: 0px; margin: 0px 0px 9px; padding-left: 0px; outline-width: 0px; padding-right: 0px; border-top-width: 0px; border-bottom-width: 0px; color: rgb(77,77,77); font-size: 13px; border-left-width: 0px; padding-top: 0px">
	<span style="font-size:14px;"><span style="font-family:arial,helvetica,sans-serif;">虽然在命令行使用wipe挺简单，但是，在图形界面下，我们希望它能集成到类似于Windows的右键菜单里，那样我们就可以在浏览某个文件/文件夹的时候，直接点击右键，在菜单里执行wipe。要达到这种的效果，你首先需要一个工具 nautilus，安装方法：apt-get install nautilus-actions</span></span></p>
<p style="padding-bottom: 0px; border-right-width: 0px; margin: 0px 0px 9px; padding-left: 0px; outline-width: 0px; padding-right: 0px; border-top-width: 0px; border-bottom-width: 0px; color: rgb(77,77,77); font-size: 13px; border-left-width: 0px; padding-top: 0px">
	<span style="font-size:14px;"><span style="font-family:arial,helvetica,sans-serif;">安装了之后，在&#8220;系统&#8221;&#8594;&#8220;首选项&#8221;里就可以看到&#8220;Nautilus 动作配置&#8221;的选项了。点击进入之后，请按下面的步骤跟着我一起，将wipe集成到右键菜单中：</span></span></p>
<p>
	<span style="font-size:14px;"><span style="font-family:arial,helvetica,sans-serif;">（1）点击工具栏的&#8220;Define a new action&#8221;按钮：</span></span></p>
<p>
	<span style="font-size:14px;"><span style="font-family:arial,helvetica,sans-serif;"><a href="http://www.codelast.com/wp-content/uploads/2010/09/1034165_1274616357gg9r.png"><img decoding="async" alt="" class="alignnone size-full wp-image-166" height="115" src="http://www.codelast.com/wp-content/uploads/2010/09/1034165_1274616357gg9r.png" title="1034165_1274616357gg9r" width="195" /></a></span></span></p>
<p>
	<span style="font-size:14px;"><span style="font-family:arial,helvetica,sans-serif;">文章来源：http://www.codelast.com/</span></span></p>
<p style="padding-bottom: 0px; border-right-width: 0px; margin: 0px 0px 9px; padding-left: 0px; outline-width: 0px; padding-right: 0px; border-top-width: 0px; border-bottom-width: 0px; color: rgb(77,77,77); font-size: 13px; border-left-width: 0px; padding-top: 0px">
	<span style="font-size:14px;"><span style="font-family:arial,helvetica,sans-serif;">（2）在各个选项卡里分别如下设置：</span></span></p>
<p>
	<span style="font-size:14px;"><span style="font-family:arial,helvetica,sans-serif;">Action选项卡：</span></span></p>
<p>
	<span style="font-size:14px;"><span style="font-family:arial,helvetica,sans-serif;"><a href="http://www.codelast.com/wp-content/uploads/2010/09/1034165_1274616358ARzX.png"><img fetchpriority="high" decoding="async" alt="" class="alignnone size-full wp-image-167" height="360" src="http://www.codelast.com/wp-content/uploads/2010/09/1034165_1274616358ARzX.png" title="1034165_1274616358ARzX" width="619" srcset="https://www.codelast.com/wp-content/uploads/2010/09/1034165_1274616358ARzX.png 619w, https://www.codelast.com/wp-content/uploads/2010/09/1034165_1274616358ARzX-300x174.png 300w" sizes="(max-width: 619px) 100vw, 619px" /></a></span></span></p>
<p>
	<span style="font-size:14px;"><span style="font-family:arial,helvetica,sans-serif;">Command选项卡：</span></span></p>
<p>
	<span style="font-size:14px;"><span style="font-family:arial,helvetica,sans-serif;"><a href="http://www.codelast.com/wp-content/uploads/2010/09/1034165_127461635983An.png"><img decoding="async" alt="" class="alignnone size-full wp-image-168" height="253" src="http://www.codelast.com/wp-content/uploads/2010/09/1034165_127461635983An.png" title="1034165_127461635983An" width="617" srcset="https://www.codelast.com/wp-content/uploads/2010/09/1034165_127461635983An.png 617w, https://www.codelast.com/wp-content/uploads/2010/09/1034165_127461635983An-300x123.png 300w" sizes="(max-width: 617px) 100vw, 617px" /></a></span></span></p>
<p>
	<span style="font-size:14px;"><span style="font-family:arial,helvetica,sans-serif;">Conditions选项卡：</span></span></p>
<p>
	<span style="font-size:14px;"><span style="font-family:arial,helvetica,sans-serif;"><a href="http://www.codelast.com/wp-content/uploads/2010/09/1034165_1274616616uVKN.png"><img loading="lazy" decoding="async" alt="" class="alignnone size-full wp-image-169" height="292" src="http://www.codelast.com/wp-content/uploads/2010/09/1034165_1274616616uVKN.png" title="1034165_1274616616uVKN" width="615" srcset="https://www.codelast.com/wp-content/uploads/2010/09/1034165_1274616616uVKN.png 615w, https://www.codelast.com/wp-content/uploads/2010/09/1034165_1274616616uVKN-300x142.png 300w" sizes="auto, (max-width: 615px) 100vw, 615px" /></a></span></span></p>
<p style="padding-bottom: 0px; border-right-width: 0px; margin: 0px 0px 9px; padding-left: 0px; outline-width: 0px; padding-right: 0px; border-top-width: 0px; border-bottom-width: 0px; color: rgb(77,77,77); font-size: 13px; border-left-width: 0px; padding-top: 0px">
	<span style="font-size:14px;"><span style="font-family:arial,helvetica,sans-serif;">文章来源：http://www.codelast.com/</span></span></p>
<p style="padding-bottom: 0px; border-right-width: 0px; margin: 0px 0px 9px; padding-left: 0px; outline-width: 0px; padding-right: 0px; border-top-width: 0px; border-bottom-width: 0px; color: rgb(77,77,77); font-size: 13px; border-left-width: 0px; padding-top: 0px">
	<span style="font-size:14px;"><span style="font-family:arial,helvetica,sans-serif;">（3）设置好之后，点击工具栏的&#8220;Record all the modified actions&#8221;按钮进行保存。</span></span></p>
<p style="padding-bottom: 0px; border-right-width: 0px; margin: 0px 0px 9px; padding-left: 0px; outline-width: 0px; padding-right: 0px; border-top-width: 0px; border-bottom-width: 0px; color: rgb(77,77,77); font-size: 13px; border-left-width: 0px; padding-top: 0px">
	&#160;</p>
<p style="padding-bottom: 0px; border-right-width: 0px; margin: 0px 0px 9px; padding-left: 0px; outline-width: 0px; padding-right: 0px; border-top-width: 0px; border-bottom-width: 0px; color: rgb(77,77,77); font-size: 13px; border-left-width: 0px; padding-top: 0px">
	<span style="font-size:14px;"><span style="font-family:arial,helvetica,sans-serif;">（4）现在我们再打开Ubuntu的文件浏览器，看看wipe是不是已经集成到右键菜单里了？例如，我们右键点击一个文件，再点击&#8220;use wipe to erase files&#8221;，wipe就开始粉碎文件了。</span></span></p>
<p style="padding-bottom: 0px; border-right-width: 0px; margin: 0px 0px 9px; padding-left: 0px; outline-width: 0px; padding-right: 0px; border-top-width: 0px; border-bottom-width: 0px; color: rgb(77,77,77); font-size: 13px; border-left-width: 0px; padding-top: 0px">
	<span style="font-size:14px;"><span style="font-family:arial,helvetica,sans-serif;">wipe粉碎文件的耗时较长，这一点与Windows下的Eraser有很大的不同，而且wipe粉碎文件时，硬盘灯几乎不闪烁。Erase粉碎文件时，硬盘灯是狂闪的，因为它在不断地用垃圾数据覆写某一块磁盘空间。所以我不知道wipe花那么长时间到底在干嘛，不过用wipe删除文件总是要放心一点的。</span></span></p>
<p style="padding-bottom: 0px; border-right-width: 0px; margin: 0px 0px 9px; padding-left: 0px; outline-width: 0px; padding-right: 0px; border-top-width: 0px; border-bottom-width: 0px; color: rgb(77,77,77); font-size: 13px; border-left-width: 0px; padding-top: 0px">
	&#160;</p>
<p style="padding-bottom: 0px; border-right-width: 0px; margin: 0px 0px 9px; padding-left: 0px; outline-width: 0px; padding-right: 0px; border-top-width: 0px; border-bottom-width: 0px; color: rgb(77,77,77); font-size: 13px; border-left-width: 0px; padding-top: 0px">
	<span style="font-size:14px;"><span style="font-family:arial,helvetica,sans-serif;">注意：由于使用了-rf参数，所以在右键菜单中用wipe粉碎文件夹/文件的时候，不会弹出任何提示，请一定要想好了再删除！</span></span></p>
<p style="padding-bottom: 0px; border-right-width: 0px; margin: 0px 0px 9px; padding-left: 0px; outline-width: 0px; padding-right: 0px; border-top-width: 0px; border-bottom-width: 0px; color: rgb(77,77,77); font-size: 13px; border-left-width: 0px; padding-top: 0px">
	<span style="font-size:14px;"><span style="font-family:arial,helvetica,sans-serif;">文章来源：http://www.codelast.com/</span></span>&#8230; <a href="https://www.codelast.com/%e5%8e%9f%e5%88%9b%e5%9c%a8linux%e4%b8%8b%e8%bf%9b%e8%a1%8c%e6%96%87%e4%bb%b6%e2%80%9c%e7%b2%89%e7%a2%8e%e2%80%9d/" class="read-more">Read More </a></p>]]></description>
										<content:encoded><![CDATA[<p>
	<span style="font-size:14px;"><span style="font-family:arial,helvetica,sans-serif;">文章来源：<a href="http://www.codelast.com/" style="padding-bottom: 0px; border-right-width: 0px; margin: 0px; padding-left: 0px; outline-width: 0px; padding-right: 0px; border-top-width: 0px; border-bottom-width: 0px; color: rgb(0,77,153); font-size: 14px; border-left-width: 0px; text-decoration: none; padding-top: 0px" target="_blank">http://www.codelast.com/</a></span></span></p>
<p>
	&nbsp;</p>
<p style="padding-bottom: 0px; border-right-width: 0px; margin: 0px 0px 9px; padding-left: 0px; outline-width: 0px; padding-right: 0px; border-top-width: 0px; border-bottom-width: 0px; color: rgb(77,77,77); font-size: 13px; border-left-width: 0px; padding-top: 0px">
	<span style="font-size:14px;"><span style="font-family:arial,helvetica,sans-serif;">众所周知Windows下的文件删除之后是有可能恢复的，对重要文件，为了增加恢复的难度，我们可以用文件粉碎工具进行文件粉碎。我最常用的是集成到资源管理器中的Eraser。那么在Linux下有没有类似的软件呢？我在一台只有Ubuntu系统的主机上，安装了一个文件粉碎工具wipe，有些想法，记下来。</span></span></p>
<p style="padding-bottom: 0px; border-right-width: 0px; margin: 0px 0px 9px; padding-left: 0px; outline-width: 0px; padding-right: 0px; border-top-width: 0px; border-bottom-width: 0px; color: rgb(77,77,77); font-size: 13px; border-left-width: 0px; padding-top: 0px">
	<span style="font-size:14px;"><span style="font-family:arial,helvetica,sans-serif;">安装：apt-get install wipe</span></span></p>
<p style="padding-bottom: 0px; border-right-width: 0px; margin: 0px 0px 9px; padding-left: 0px; outline-width: 0px; padding-right: 0px; border-top-width: 0px; border-bottom-width: 0px; color: rgb(77,77,77); font-size: 13px; border-left-width: 0px; padding-top: 0px">
	<span style="font-size:14px;"><span style="font-family:arial,helvetica,sans-serif;">wipe有没有GUI我不知道，命令行也不难用：</span></span></p>
<p style="padding-bottom: 0px; border-right-width: 0px; margin: 0px 0px 9px; padding-left: 0px; outline-width: 0px; padding-right: 0px; border-top-width: 0px; border-bottom-width: 0px; color: rgb(77,77,77); font-size: 13px; border-left-width: 0px; padding-top: 0px">
<span id="more-165"></span></p>
<p style="padding-bottom: 0px; border-right-width: 0px; margin: 0px 0px 9px; padding-left: 0px; outline-width: 0px; padding-right: 0px; border-top-width: 0px; border-bottom-width: 0px; color: rgb(77,77,77); font-size: 13px; border-left-width: 0px; padding-top: 0px">
	<span style="font-size:14px;"><span style="font-family:arial,helvetica,sans-serif;">粉碎一个文件：wipe 文件名</span></span></p>
<p style="padding-bottom: 0px; border-right-width: 0px; margin: 0px 0px 9px; padding-left: 0px; outline-width: 0px; padding-right: 0px; border-top-width: 0px; border-bottom-width: 0px; color: rgb(77,77,77); font-size: 13px; border-left-width: 0px; padding-top: 0px">
	<span style="font-size:14px;"><span style="font-family:arial,helvetica,sans-serif;">粉碎一个文件夹：wipe -rf 文件夹名</span></span></p>
<p style="padding-bottom: 0px; border-right-width: 0px; margin: 0px 0px 9px; padding-left: 0px; outline-width: 0px; padding-right: 0px; border-top-width: 0px; border-bottom-width: 0px; color: rgb(77,77,77); font-size: 13px; border-left-width: 0px; padding-top: 0px">
	<span style="font-size:14px;"><span style="font-family:arial,helvetica,sans-serif;">（更多用法，请参考 wipe -h）</span></span></p>
<p style="padding-bottom: 0px; border-right-width: 0px; margin: 0px 0px 9px; padding-left: 0px; outline-width: 0px; padding-right: 0px; border-top-width: 0px; border-bottom-width: 0px; color: rgb(77,77,77); font-size: 13px; border-left-width: 0px; padding-top: 0px">
	<span style="font-size:14px;"><span style="font-family:arial,helvetica,sans-serif;">虽然在命令行使用wipe挺简单，但是，在图形界面下，我们希望它能集成到类似于Windows的右键菜单里，那样我们就可以在浏览某个文件/文件夹的时候，直接点击右键，在菜单里执行wipe。要达到这种的效果，你首先需要一个工具 nautilus，安装方法：apt-get install nautilus-actions</span></span></p>
<p style="padding-bottom: 0px; border-right-width: 0px; margin: 0px 0px 9px; padding-left: 0px; outline-width: 0px; padding-right: 0px; border-top-width: 0px; border-bottom-width: 0px; color: rgb(77,77,77); font-size: 13px; border-left-width: 0px; padding-top: 0px">
	<span style="font-size:14px;"><span style="font-family:arial,helvetica,sans-serif;">安装了之后，在&ldquo;系统&rdquo;&rarr;&ldquo;首选项&rdquo;里就可以看到&ldquo;Nautilus 动作配置&rdquo;的选项了。点击进入之后，请按下面的步骤跟着我一起，将wipe集成到右键菜单中：</span></span></p>
<p>
	<span style="font-size:14px;"><span style="font-family:arial,helvetica,sans-serif;">（1）点击工具栏的&ldquo;Define a new action&rdquo;按钮：</span></span></p>
<p>
	<span style="font-size:14px;"><span style="font-family:arial,helvetica,sans-serif;"><a href="http://www.codelast.com/wp-content/uploads/2010/09/1034165_1274616357gg9r.png"><img loading="lazy" decoding="async" alt="" class="alignnone size-full wp-image-166" height="115" src="http://www.codelast.com/wp-content/uploads/2010/09/1034165_1274616357gg9r.png" title="1034165_1274616357gg9r" width="195" /></a></span></span></p>
<p>
	<span style="font-size:14px;"><span style="font-family:arial,helvetica,sans-serif;">文章来源：http://www.codelast.com/</span></span></p>
<p style="padding-bottom: 0px; border-right-width: 0px; margin: 0px 0px 9px; padding-left: 0px; outline-width: 0px; padding-right: 0px; border-top-width: 0px; border-bottom-width: 0px; color: rgb(77,77,77); font-size: 13px; border-left-width: 0px; padding-top: 0px">
	<span style="font-size:14px;"><span style="font-family:arial,helvetica,sans-serif;">（2）在各个选项卡里分别如下设置：</span></span></p>
<p>
	<span style="font-size:14px;"><span style="font-family:arial,helvetica,sans-serif;">Action选项卡：</span></span></p>
<p>
	<span style="font-size:14px;"><span style="font-family:arial,helvetica,sans-serif;"><a href="http://www.codelast.com/wp-content/uploads/2010/09/1034165_1274616358ARzX.png"><img loading="lazy" decoding="async" alt="" class="alignnone size-full wp-image-167" height="360" src="http://www.codelast.com/wp-content/uploads/2010/09/1034165_1274616358ARzX.png" title="1034165_1274616358ARzX" width="619" srcset="https://www.codelast.com/wp-content/uploads/2010/09/1034165_1274616358ARzX.png 619w, https://www.codelast.com/wp-content/uploads/2010/09/1034165_1274616358ARzX-300x174.png 300w" sizes="auto, (max-width: 619px) 100vw, 619px" /></a></span></span></p>
<p>
	<span style="font-size:14px;"><span style="font-family:arial,helvetica,sans-serif;">Command选项卡：</span></span></p>
<p>
	<span style="font-size:14px;"><span style="font-family:arial,helvetica,sans-serif;"><a href="http://www.codelast.com/wp-content/uploads/2010/09/1034165_127461635983An.png"><img loading="lazy" decoding="async" alt="" class="alignnone size-full wp-image-168" height="253" src="http://www.codelast.com/wp-content/uploads/2010/09/1034165_127461635983An.png" title="1034165_127461635983An" width="617" srcset="https://www.codelast.com/wp-content/uploads/2010/09/1034165_127461635983An.png 617w, https://www.codelast.com/wp-content/uploads/2010/09/1034165_127461635983An-300x123.png 300w" sizes="auto, (max-width: 617px) 100vw, 617px" /></a></span></span></p>
<p>
	<span style="font-size:14px;"><span style="font-family:arial,helvetica,sans-serif;">Conditions选项卡：</span></span></p>
<p>
	<span style="font-size:14px;"><span style="font-family:arial,helvetica,sans-serif;"><a href="http://www.codelast.com/wp-content/uploads/2010/09/1034165_1274616616uVKN.png"><img loading="lazy" decoding="async" alt="" class="alignnone size-full wp-image-169" height="292" src="http://www.codelast.com/wp-content/uploads/2010/09/1034165_1274616616uVKN.png" title="1034165_1274616616uVKN" width="615" srcset="https://www.codelast.com/wp-content/uploads/2010/09/1034165_1274616616uVKN.png 615w, https://www.codelast.com/wp-content/uploads/2010/09/1034165_1274616616uVKN-300x142.png 300w" sizes="auto, (max-width: 615px) 100vw, 615px" /></a></span></span></p>
<p style="padding-bottom: 0px; border-right-width: 0px; margin: 0px 0px 9px; padding-left: 0px; outline-width: 0px; padding-right: 0px; border-top-width: 0px; border-bottom-width: 0px; color: rgb(77,77,77); font-size: 13px; border-left-width: 0px; padding-top: 0px">
	<span style="font-size:14px;"><span style="font-family:arial,helvetica,sans-serif;">文章来源：http://www.codelast.com/</span></span></p>
<p style="padding-bottom: 0px; border-right-width: 0px; margin: 0px 0px 9px; padding-left: 0px; outline-width: 0px; padding-right: 0px; border-top-width: 0px; border-bottom-width: 0px; color: rgb(77,77,77); font-size: 13px; border-left-width: 0px; padding-top: 0px">
	<span style="font-size:14px;"><span style="font-family:arial,helvetica,sans-serif;">（3）设置好之后，点击工具栏的&ldquo;Record all the modified actions&rdquo;按钮进行保存。</span></span></p>
<p style="padding-bottom: 0px; border-right-width: 0px; margin: 0px 0px 9px; padding-left: 0px; outline-width: 0px; padding-right: 0px; border-top-width: 0px; border-bottom-width: 0px; color: rgb(77,77,77); font-size: 13px; border-left-width: 0px; padding-top: 0px">
	&nbsp;</p>
<p style="padding-bottom: 0px; border-right-width: 0px; margin: 0px 0px 9px; padding-left: 0px; outline-width: 0px; padding-right: 0px; border-top-width: 0px; border-bottom-width: 0px; color: rgb(77,77,77); font-size: 13px; border-left-width: 0px; padding-top: 0px">
	<span style="font-size:14px;"><span style="font-family:arial,helvetica,sans-serif;">（4）现在我们再打开Ubuntu的文件浏览器，看看wipe是不是已经集成到右键菜单里了？例如，我们右键点击一个文件，再点击&ldquo;use wipe to erase files&rdquo;，wipe就开始粉碎文件了。</span></span></p>
<p style="padding-bottom: 0px; border-right-width: 0px; margin: 0px 0px 9px; padding-left: 0px; outline-width: 0px; padding-right: 0px; border-top-width: 0px; border-bottom-width: 0px; color: rgb(77,77,77); font-size: 13px; border-left-width: 0px; padding-top: 0px">
	<span style="font-size:14px;"><span style="font-family:arial,helvetica,sans-serif;">wipe粉碎文件的耗时较长，这一点与Windows下的Eraser有很大的不同，而且wipe粉碎文件时，硬盘灯几乎不闪烁。Erase粉碎文件时，硬盘灯是狂闪的，因为它在不断地用垃圾数据覆写某一块磁盘空间。所以我不知道wipe花那么长时间到底在干嘛，不过用wipe删除文件总是要放心一点的。</span></span></p>
<p style="padding-bottom: 0px; border-right-width: 0px; margin: 0px 0px 9px; padding-left: 0px; outline-width: 0px; padding-right: 0px; border-top-width: 0px; border-bottom-width: 0px; color: rgb(77,77,77); font-size: 13px; border-left-width: 0px; padding-top: 0px">
	&nbsp;</p>
<p style="padding-bottom: 0px; border-right-width: 0px; margin: 0px 0px 9px; padding-left: 0px; outline-width: 0px; padding-right: 0px; border-top-width: 0px; border-bottom-width: 0px; color: rgb(77,77,77); font-size: 13px; border-left-width: 0px; padding-top: 0px">
	<span style="font-size:14px;"><span style="font-family:arial,helvetica,sans-serif;">注意：由于使用了-rf参数，所以在右键菜单中用wipe粉碎文件夹/文件的时候，不会弹出任何提示，请一定要想好了再删除！</span></span></p>
<p style="padding-bottom: 0px; border-right-width: 0px; margin: 0px 0px 9px; padding-left: 0px; outline-width: 0px; padding-right: 0px; border-top-width: 0px; border-bottom-width: 0px; color: rgb(77,77,77); font-size: 13px; border-left-width: 0px; padding-top: 0px">
	<span style="font-size:14px;"><span style="font-family:arial,helvetica,sans-serif;">文章来源：http://www.codelast.com/</span></span></p>
<p style="padding-bottom: 0px; border-right-width: 0px; margin: 0px 0px 9px; padding-left: 0px; outline-width: 0px; padding-right: 0px; border-top-width: 0px; border-bottom-width: 0px; color: rgb(77,77,77); font-size: 13px; border-left-width: 0px; padding-top: 0px">
	<span style="font-size:14px;"><span style="font-family:arial,helvetica,sans-serif;">另外我还看到一款类似的软件，大家可以参考一下：<a href="http://sourceforge.net/projects/wipefreespace/">http://sourceforge.net/projects/wipefreespace/</a></span></span></p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.codelast.com/%e5%8e%9f%e5%88%9b%e5%9c%a8linux%e4%b8%8b%e8%bf%9b%e8%a1%8c%e6%96%87%e4%bb%b6%e2%80%9c%e7%b2%89%e7%a2%8e%e2%80%9d/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
