<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Incident-Prevention on ShieldedBytes</title>
    <link>https://linuxeries.org/tags/incident-prevention/</link>
    <description>Recent content in Incident-Prevention on ShieldedBytes</description>
    <generator>Hugo</generator>
    <language>en</language>
    <lastBuildDate>Mon, 02 Nov 2026 10:37:33 +0200</lastBuildDate>
    <atom:link href="https://linuxeries.org/tags/incident-prevention/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>How to Fix “find … -delete” Going on the Wrong Directory by Adding a Safety Check with `-maxdepth` and `-mindepth`</title>
      <link>https://linuxeries.org/post/2026-11-02-how-to-fix-find-delete-going-on-the-wrong-dir/</link>
      <pubDate>Mon, 02 Nov 2026 10:37:33 +0200</pubDate>
      <guid>https://linuxeries.org/post/2026-11-02-how-to-fix-find-delete-going-on-the-wrong-dir/</guid>
      <description>&lt;h2 id=&#34;the-find---delete-catastrophe-and-how-to-stop-it&#34;&gt;The “find … -delete” Catastrophe and How to Stop It&lt;/h2&gt;&#xA;&lt;p&gt;A single typo in a &lt;code&gt;find&lt;/code&gt; command can wipe a production directory, a backup, or an entire filesystem. The classic recipe that trips even seasoned sysadmins is:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;find / -name &lt;span class=&#34;s1&#34;&gt;&amp;#39;*.tmp&amp;#39;&lt;/span&gt; -delete&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;If the leading slash is omitted or the pattern is too broad, the command starts at the wrong root and deletes everything that matches. In 2025, a handful of high‑profile incidents were traced back to this exact mistake, underscoring that defensive scripting is as much about guardrails as it is about automation.&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
