I have taken to a new habit (as in for the last few years) of doing the
following when I actually remove things with wild card:
mv <toberemoved> <some random string name>
rm -rf (or whatever> random string from above.
this solves two things I don't want to have happen under my fingers, due
to bash recalling things. I don't ever routinely type rm * in any form,
which my fingers may do on their own if I were to use that routinely.
I also don't have any rm * strings backup in my shell history to jump in
and surprise me later.
This has saved me a few times, or potentially saved me from the history
standpoint, so I guess it is worth it.
I also like the mv command because anything that doesn't move gracefully
probably will have issues being rm'ed and finding the problem before the
directory vanishes, or is partly destroyed is good as well.
I have watched rm * and so forth being typed while observing others, and
recall a few huge "oopses" as far back as early interactive unix days
for me.
Multics had this issue as well as its syntax would allow recursive
deletion and had the same problems (which is where I came from before Unix).
TSO didn't have this as I recall since it didn't have much of a file
system. It was also another interactive system I had early experience
on but was more akin to CP/M as far as files than *ix type systems.
Jim
On 12/16/2011 5:40 PM, Toby Thain wrote:
On 16/12/11 12:53 PM, Josh Dersch wrote:
... Remember that the next time you type "rm
* .o"
instead of "rm *.o" by mistake. :)
(Yes I know Unix gurus never make typos, it's purely hypothetical.)
Well, I'm probably not a 'guru', but I've certainly made THAT
particular typo once that I recall. :)
--Toby
- Josh