<?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>gHacks Technology News &#124; Latest Tech News, Software And Tutorials &#187; shred</title> <atom:link href="http://www.ghacks.net/tag/shred/feed/" rel="self" type="application/rss+xml" /><link>http://www.ghacks.net</link> <description>A technology news blog covering software, mobile phones, gadgets, security, the Internet and other relevant areas.</description> <lastBuildDate>Sat, 11 Feb 2012 09:52:46 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.1</generator> <atom:link rel="hub" href="http://pubsubhubbub.appspot.com"/><atom:link rel="hub" href="http://superfeedr.com/hubbub"/> <item><title>Get to know Linux: Removing files</title><link>http://www.ghacks.net/2009/05/20/get-to-know-linux-removing-files/</link> <comments>http://www.ghacks.net/2009/05/20/get-to-know-linux-removing-files/#comments</comments> <pubDate>Wed, 20 May 2009 03:00:27 +0000</pubDate> <dc:creator>Jack Wallen</dc:creator> <category><![CDATA[Advice]]></category> <category><![CDATA[Linux]]></category> <category><![CDATA[Open Source]]></category> <category><![CDATA[Tutorials Basic]]></category> <category><![CDATA[file deletion]]></category> <category><![CDATA[permanently delete files]]></category> <category><![CDATA[shred]]></category> <category><![CDATA[trash]]></category> <guid
isPermaLink="false">http://www.ghacks.net/2009/05/20/get-to-know-linux-removing-files/</guid> <description><![CDATA[As you all know, with Linux there are numerous ways to deal with each and every task. Some of these ways are obvious, some are subtle, and some are as brute-force as an NFL offensive line. Each of these methods will do the same thing but, in some cases, the results are a bit different. [...]]]></description> <content:encoded><![CDATA[<p>As you all know, with Linux there are numerous ways to deal with each and every task. Some of these ways are obvious, some are subtle, and some are as brute-force as an NFL offensive line. Each of these methods will do the same thing but, in some cases, the results are a bit different.</p><p>Such is the case with removing files. There are two fundamental ways to remove a file:</p><p>With the help of a GUI such as Thunar, Dolphin, or Nautilus</p><p>With the help of a command such as rm or shred.</p><p>In this article we will primarily examine the latter and touch on the former.</p><p><span
id="more-12947"></span><strong>The former &#8211; GUI</strong></p><p>As you would expect, in all three of the graphical file managers you can easily remove a file simply by right clicking the file and selecting Delete. There are, however, some subtle differences. You will notice, in both Dolphin and Nautilus you can choose between Deleting a file and moving a file to the Trash. This behavior mimics that of Windows Explorer. Once you move a file to the Trash it will remain there until you empty your trash. Should you select to actually Delete the file, however, that file is deleted right away.</p><p>This behavior is not available in Thunar. With Thunar you can keep it or delete it.</p><p><strong>rm that file</strong></p><p>The basic remove command is <em>rm</em>. It is used like this:</p><p><em>rm OPTIONS</em></p><p>Believe it or not there are options to go along with the rm command. There are two options that are used most often:</p><p>f &#8211; This option will force the delete. In other words you will not have to answer &#8220;y&#8221; to every file you want to delete. This is very handy when you are deleted a directory.</p><p>r &#8211; This option will recursively delete all files within a directory as well as the directory itself.</p><p>As you can surmise, the r and f options are most often used together. So to delete the <strong>~/TEST</strong> directory and all of its files you would issue the command:</p><p><em>rm -rf ~/TEST</em></p><p>If you only wanted to delete the file <strong>test.txt </strong>within the <strong>~/TEST</strong> directory you would issue the command:</p><p><em>rm ~/TEST/test.txt</em></p><p>What if you wanted to delete all jpg files within the <strong>~/TEST</strong> directory? Simple:</p><p><em>rm -f ~/TEST/*.jpg</em></p><p>The * character is a wild card which means, in this case, anything that ends with .jpg. Notice the &#8220;.&#8221;. If you leave that out you can delete any file ending in jpg &#8211; not just any file with the extension .jpg.</p><p><strong>shredd&#8217;ing a file</strong></p><p>The shred command is a whole different beast. Shred is for the paranoid. Shred completely obliviates a file by overwriting its contents. Instead of deleting a file shred will simply overwrite a file and the end results will be an unreadable binary file that can then be safely removed.</p><p>And no matter how paranoid you are, shred will help you out. You can declare how many overwrite iterations shred will perform. You can even add a final overwrite of nothing but zeros to hide the fact that you ever shredded a file. And finally, you can also add a switch to inform shred to automatically remove the file after the iterations.</p><p>Shred is used like so:</p><p>shred OPTIONS filename</p><p>The most popular options are:</p><p>v &#8211; Show progress.</p><p>z &#8211; Add final overwrite of zeros.</p><p>u &#8211; Remove file after iterations</p><p>n &#8211; Overwrites <em>n </em>times</p><p>So to shred a file by iterating 10 times, followed by a final iteration of zeros, and then deleting the file upon completion you would issue the command:</p><p>shred -v -n 10 -z  FILENAME -u</p><p>Where FILENAME is the actual file name.</p><p>After that command your removed file has vanished into thin air.</p><p><strong>Final thoughts</strong></p><p>Many different routes to the same destination. Of this, Linux is the master. In the case of removing files, you can send it to the trash for possible later easy retrieval, remove it with the possibility of a much more difficult retrieval, or shred it with no hopes of retrieval. Your call.</p> ]]></content:encoded> <wfw:commentRss>http://www.ghacks.net/2009/05/20/get-to-know-linux-removing-files/feed/</wfw:commentRss> <slash:comments>3</slash:comments> </item> </channel> </rss>
