disaster recovery - did I do the right thing?

George d1945 at sbcglobal.net
Sun May 6 02:54:05 UTC 2007


On Sat, May 05, 2007 at 06:10:36PM -0700, Garrett Cooper wrote:
> Martin Tournoij wrote:
> > On Sat 05 May 2007 17:05, Ray wrote:
> > > The mistake:
> > > /usr/local/# rm -f *
> > > note that root was running bash as a shell at the time, found 
> > > in /usr/local/bin or something.
> > > 
> > > What I did was to start over, reinstall from scratch.  my
> > > question, was there an easier way?
> > 
> > You can use pkg_info -ga to check for missing files in your
> > packages.
> 
> For (t)csh:
> alias rm "rm -i"
> 
> For (ba)sh:
> alias rm="rm -i"

Or for more fun and amusement:

touch -- /usr/local/-i

Unfortunately, the OP explicitly used the -f switch, so the alias
suggestions wouldn't have helped.  

Personally, I'd recommend learning from the mistake (we've all done at
least once) and being more judicious when entering commands,
particularly any 'force' switches, and making regular use of dump(8).
That would avoid circumvent the possibility of developing the unwelcome
habit of typing 'rm -f' to compensate for the increased level of
interaction if aliasing 'rm -i'.  Which may be why the OP got into
trouble.






More information about the freebsd-questions mailing list