<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>nyarla-net</author_name>
  <author_url>https://blog.hatena.ne.jp/nyarla-net/</author_url>
  <blog_title>カラクリサイクル</blog_title>
  <blog_url>https://nyarla.net/</blog_url>
  <categories>
    <anon>小ネタ</anon>
    <anon>開発</anon>
    <anon>シェル</anon>
  </categories>
  <description>本日の小ネタ。 文脈 よくインターネットでは特定のディレクトリを消そうとして、 rm -rf / # ここで補完をしようと思った と言う大事故が起きたりしますが、これを比較的安全に運用する方法を紹介したいと思います。 やり方 これらの小ネタはNixOS上のzshとGNU coreutilsを前提としています。 1. コマンド引数を後置にする $ rm target/ -rf コツとしては rm コマンドの直後に削除したいディレクトリ名を指定し、 その後で -rf などの引数を付ける、というスタイルでコマンドを打つことです。 こうすると意図しないディレクトリの削除が起きにくく、比較的事故を防げま…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fnyarla.net%2F2025%2F04%2F03%2F000000&quot; title=&quot;`rm` コマンドをちょっとだけ安全に運用する方法 - カラクリサイクル&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2025-04-03 12:00:00</published>
  <title>`rm` コマンドをちょっとだけ安全に運用する方法</title>
  <type>rich</type>
  <url>https://nyarla.net/2025/04/03/000000</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
