home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / unix / aix / 8055 < prev    next >
Encoding:
Text File  |  1992-07-22  |  1.1 KB  |  35 lines

  1. Newsgroups: comp.unix.aix
  2. Path: sparky!uunet!ddssuprs!fred
  3. From: fred@dickens.com (Fred Stearns)
  4. Subject: Re: find bug
  5. Message-ID: <1992Jul22.120003.15122@dickens.com>
  6. Date: Wed, 22 Jul 1992 12:00:03 GMT
  7. Distribution: usa
  8. References: <1992Jul21.181917.749@ccd.harris.com>
  9. Organization: Dickens Data Systems, Inc.
  10. Lines: 23
  11.  
  12. In article <1992Jul21.181917.749@ccd.harris.com> tvd@ccd.harris.com (Tom Denham) writes:
  13. >From tvd Tue Jul 21 09:25:04 1992
  14. >Subject: find
  15. >To: nam (Noahal A. Mundt)
  16. >Date: Tue, 21 Jul 92 9:25:04 EDT
  17. >X-Mailer: ELM [version 2.3 PL11]
  18. >
  19. >Noahal, I checked this out and I don't think it's true.
  20. >
  21. >>I recently realized that /etc/skulker on my machines was not clearing out
  22. >>/tmp and /etc.tmp as it should.  A bit of playing around and I discovered
  23. >>that the problem is with find.  The following command, for instance:
  24. >
  25. >>  find /tmp -mtime +1 -type f -exec /bin/rm {} \;
  26. >
  27.  
  28. Check out the command xargs.  You can do the following:
  29.  
  30. find /tmp -mtime +1 -type f -print | xargs rm
  31.  
  32. It is much more efficient as rm is fork/exec'd once for a
  33. bunch of files.  As opposed to once for each file.
  34.  
  35.