Computational complexity of rm & ls

Danny danny at itm.UUCP
Tue Mar 14 23:45:47 AEST 1989


In article <TALE.89Mar13170500 at imagine.pawl.rpi.edu> tale at pawl.rpi.edu writes:
~Invoking ls to pipe to xargs which calls rm is not the
~optimum strategy.

    The best "stragety" (thanks, Bugs) I've ever heard of is:
        use clri to zap the directory,
        and fsck to clean up the mess.
    
    The story began with a news-passing scheme which saved articles as
files in a directory to be passed to another machine.  When said machine
was down, the directory grew.  Gatech had literally thousands of files
to be sent, so, they either copied them to tape, or said, "Forget it!"
Then came the rm.  It ran overnight, and was still far from done.  One
of the gurus from MSDC (Hi Dan!) suggested the above idea, which took
about 10 minutes.  Ok, ok, you do have to unmount the partition, but,
even so, quadratic it ain't.

    WARNING!  Not for the faint-of-heart!  "Experience and informed
courage count for much." - from someplace in the Version 7 man pages,
dealing with addled file systems.

                                    Danny
-- 
				Daniel S. Cox
				(seismo!gatech!itm!danny)



More information about the Comp.unix.questions mailing list