Computational complexity of rm & ls

David C Lawrence tale at pawl.rpi.edu
Tue Mar 14 08:05:00 AEST 1989


In article <9000012 at m.cs.uiuc.edu>, wsmith at m.cs.uiuc.edu writes:
wsmith> [...]   "rm *" seems to be a common
wsmith> enough idiom that rm could be optimized to handle that case better.

In article <1541 at zen.UUCP> frank at zen.co.uk (Frank Wales) wrote:
FW>Maybe adding a '-A' (for All, harder to type than '-a') option to rm would
FW>be justified.

In article <871 at Portia.Stanford.EDU> karish at forel.stanford.edu
(Chuck Karish) writes:
CK> Great, another feature!  How about using an alias instead:
CK> 
CK> 	alias rmall 'ls -f | xargs rm -f'
CK> 
CK> This avoids the overhead of sorting the names in the directory.
CK> It also suppresses those annoying queries from rm.

By your own quoting, Chuck, the reason Frank suggested -A was for
optimization.  Invoking ls to pipe to xargs which calls rm is not the
optimum strategy.
--
      tale at rpitsmts.bitnet, tale%mts at rpitsgw.rpi.edu, tale at pawl.rpi.edu



More information about the Comp.unix.questions mailing list