{"id":10244,"date":"2006-06-28T21:01:11","date_gmt":"2006-06-28T18:01:11","guid":{"rendered":"https:\/\/mamchenkov.net\/wordpress\/2006\/06\/28\/rm-on-steroids-a-safer-way\/"},"modified":"2006-06-28T21:04:07","modified_gmt":"2006-06-28T18:04:07","slug":"rm-on-steroids-a-safer-way","status":"publish","type":"post","link":"https:\/\/mamchenkov.net\/wordpress\/2006\/06\/28\/rm-on-steroids-a-safer-way\/","title":{"rendered":"rm on steroids (a safer way)"},"content":{"rendered":"<!-- google_ad_section_start -->\n<p>I came across <a href=\"http:\/\/weblogtoolscollection.com\/archives\/2006\/06\/28\/rm-on-steroids-in-linux\/\">an excellent tip<\/a> about mixing <code>rm<\/code> and <code>find<\/code> commands in Linux shell.  <\/p>\n<p>The only thing I&#8217;d add to it is a bit of safety.  Before executing the mix of <code>find<\/code> and <code>rm<\/code>, run the <code>find<\/code> command with the same options, but without <code>rm<\/code>.  It will print out the files that match your search.  These files are about to be deleted, so it&#8217;s a good thing to review them first.<\/p>\n<p>By the way, I do exactly the same thing when working with SQL.  If I need to delete something, I first create a <code>SELECT<\/code> statement that matches everything I need gone.  And only when I am sure about the results, I change the <code>SELECT<\/code> to <code>DELETE<\/code>.<\/p>\n<p>It&#8217;s been ages since I deleted something that I didn&#8217;t intend&#8230;<\/p>\n<p><ins datetime=\"2006-06-28T18:02:50+00:00\">Update<\/ins>: Obviously, I haven&#8217;t read the comments before posting.  My suggestions has already been suggested.<\/p>\n<!-- google_ad_section_end -->\n","protected":false},"excerpt":{"rendered":"<!-- google_ad_section_start -->\n<p>I came across an excellent tip about mixing rm and find commands in Linux shell. The only thing I&#8217;d add to it is a bit of safety. Before executing the mix of find and rm, run the find command with the same options, but without rm. It will print out the files that match your &hellip; <a href=\"https:\/\/mamchenkov.net\/wordpress\/2006\/06\/28\/rm-on-steroids-a-safer-way\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">rm on steroids (a safer way)<\/span><\/a><\/p>\n<!-- google_ad_section_end -->\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"_links_to":"","_links_to_target":""},"categories":[1],"tags":[],"keyring_services":[],"class_list":["post-10244","post","type-post","status-publish","format-standard","hentry","category-general"],"aioseo_notices":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack-related-posts":[{"id":8233,"url":"https:\/\/mamchenkov.net\/wordpress\/2004\/11\/18\/format-c-versus-rm-rf\/","url_meta":{"origin":10244,"position":0},"title":"&#8220;format C:&#8221; versus &#8220;rm -rf \/&#8221;","author":"Leonid Mamchenkov","date":"November 18, 2004","format":false,"excerpt":"Jokes about \"format C:\" and \"rm -rf \/\" are pretty frequent in the computer universe. These two commands will supposedely remove all data from the hard disk - one on DOS\/Windows and another on UNIX operating systems. While widely used, this might not be exactly true. This guy has tried\u2026","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":7364,"url":"https:\/\/mamchenkov.net\/wordpress\/2004\/03\/23\/resizing-or-rotating-a-banch-of-images\/","url_meta":{"origin":10244,"position":1},"title":"Resizing or rotating a banch of images","author":"Leonid Mamchenkov","date":"March 23, 2004","format":false,"excerpt":"It is very often that one has a need to rotate a bunch of images by 90 or 180 degrees clockwise or otherwise, or resize the same bunch of images to a certain size. Read more to learn how you can do it. First of all, you should defenetely install\u2026","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":18764,"url":"https:\/\/mamchenkov.net\/wordpress\/2013\/11\/14\/rf-rf-horror-stories\/","url_meta":{"origin":10244,"position":2},"title":"rm -rf \/ horror stories","author":"Leonid Mamchenkov","date":"November 14, 2013","format":false,"excerpt":"Someone asked Quora community to share the craziest \"rm -rf \/\" stories. \u00a0 There are quite a few good ones, including this video from Pixar about Toy Story 2 almost not happening.","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/img.youtube.com\/vi\/EL_g0tyaIeE\/0.jpg?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":11586,"url":"https:\/\/mamchenkov.net\/wordpress\/2009\/06\/16\/delete-files-dialogue-in-kde-ugly\/","url_meta":{"origin":10244,"position":3},"title":"Delete files dialogue in KDE = ugly","author":"Leonid Mamchenkov","date":"June 16, 2009","format":false,"excerpt":"As I am getting used to KDE 4 more and more, I am enjoying it more and more.\u00a0 It delivers plenty of visual pleasure while being quite fast and user friendly.\u00a0 However, there this one tiny little thing which annoyed the heck out of me since ancient times.\u00a0\u00a0 It's the\u2026","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"KDE delete files dialogue","src":"https:\/\/i0.wp.com\/mamchenkov.net\/wordpress\/wp-content\/uploads\/2009\/06\/kde_delete_files_dialog.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":28529,"url":"https:\/\/mamchenkov.net\/wordpress\/2018\/04\/27\/git-clean-a-nice-addition-to-git-reset\/","url_meta":{"origin":10244,"position":4},"title":"git clean &#8211; a nice addition to git reset","author":"Leonid Mamchenkov","date":"April 27, 2018","format":false,"excerpt":"Anybody working with git is probably well familiar with the way to undo the non-committed changes: As useful as the above command is, it still leaves some room for improvement. The above command will only undo non-committed changes on the files that git is tracking. Often, this would leave a\u2026","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":7368,"url":"https:\/\/mamchenkov.net\/wordpress\/2004\/03\/23\/fix-rpm-process-hanging-on-a-red-hat-linux-installation\/","url_meta":{"origin":10244,"position":5},"title":"Fix RPM process hanging on a Red Hat Linux installation","author":"Leonid Mamchenkov","date":"March 23, 2004","format":false,"excerpt":"Unfortunately, it happens rather often recently that Red Hat Package Manager (rpm) just hangs during some operation. After it does so, rpm stops working completely and even reboot (hehe) doesn't help. Well, the problem is well known and is in Red Hat's bugzilla. For now, here is a quick fix\u2026","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"jetpack_sharing_enabled":true,"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/posts\/10244","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/comments?post=10244"}],"version-history":[{"count":0,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/posts\/10244\/revisions"}],"wp:attachment":[{"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/media?parent=10244"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/categories?post=10244"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/tags?post=10244"},{"taxonomy":"keyring_services","embeddable":true,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/keyring_services?post=10244"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}