<br><br><div class="gmail_quote">On Wed, Mar 27, 2013 at 1:14 AM, Bruno Wolff III <span dir="ltr"><<a href="mailto:bruno@wolff.to" target="_blank">bruno@wolff.to</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="HOEnZb"><div class="h5">On Tue, Mar 26, 2013 at 22:23:29 +1100,<br>
Celik <<a href="mailto:celik.n.00@gmail.com" target="_blank">celik.n.00@gmail.com</a>> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi,<br>
<br>
Had a logic error in my bash script and did "rm -rf *" on my current<br>
working directory. Any tips for undoing such an error?<br>
</blockquote>
<br></div></div>
I've done worse. I once did rm -rf .* to try to remove some config files in a home directory. I forgot that .* matched .. and deleted a lot of stuff I didn't want to.<br>
</blockquote></div><br>Bruno, after such an experience, did you come up with an alternative solution to using "rm -rf"?<br>"rm -i" is good as it prompts before deletion however it becomes tedious if there are a lot of files to be deleted, hence "rm -rf" seems ideal but dangerous if not cautious :(<br>
Had a look on google, there was one particular recommendation that caught me attention (sorry I don't have the link). It was recommended to mv the files (and/or folders) to be deleted into a tmp directory. I'm planning to try that in my future code, we'll see how things go.<br>
<br>Regards,<br>C<br>