tag:dreamwidth.org,2012-03-19:1579314The Disparate Musings of Pixiepinterfacepinterface2013-04-22T04:09:30Ztag:dreamwidth.org,2012-03-19:1579314:783A Public Service Announcement About rm and tildes2013-04-22T04:09:30Z2013-04-22T04:09:30Zembarrassedpublic0<p>If you happen to be lax in upgrading software, you might have an older version of magit where if M-x magit-status is allowed to initialize a git repository where none was before, it has a tendency to create said repository in the directory '$HOME/repo/~/repo'[1].</p>
<p>If this happens, and one wishes to remove that annoying and non-useful '~' directory, do not, I repeat, do not run the command:</p>
<blockquote>rm -r ~</blockquote>
<p>That is bad. Remember shell expansion! You need to quote the tilde:</p>
<blockquote>rm -r '~'</blockquote>
<p>But also note that even the latter should not be done within eshell, as it seems to be intent on expanding the tilde anyway. Use a real shell.</p>
<p>Also, <em>always</em> do <tt>`ls $dir`</tt> before you do <tt>`rm $dir`</tt>, just to double-check what you're deleting. Even if you're sure, check anyway.</p>
<p>Because otherwise, you might accidentally delete your home directory.</p>
<p style="margin-top: 4em;">On the bright side, I can now confirm my backups work.</p>
<p>[1] see <a href="https://github.com/magit/magit/issues/383">bug 383</a></p><br /><br /><img src="https://www.dreamwidth.org/tools/commentcount?user=pinterface&ditemid=783" width="30" height="12" alt="comment count unavailable" style="vertical-align: middle;"/> comments