Path: utzoo!utgpu!utstat!jarvis.csri.toronto.edu!mailrus!cwjcc!tut.cis.ohio-state.edu!osu-cis!att!ttrdc!levy From: levy@ttrdc.UUCP (Daniel R. Levy) Newsgroups: comp.unix.questions Subject: Re: cleanup script needed Message-ID: <3256@ttrdc.UUCP> Date: 10 Mar 89 00:37:31 GMT References: <15659@oberon.USC.EDU> <9793@smoke.BRL.MIL> <80@torsqnt.UUCP> Lines: 20 In article <80@torsqnt.UUCP>, david@torsqnt.UUCP (David Haynes) writes: > :No, try "find . -name '*.dvi' -print | xargs rm". > : > Why not, "find . -type f -name '*.dvi' -exec rm {} \;" ? Which is better in some ways, since in the first example (using xargs) if rm finds a *.dvi file without write permission to you or which it otherwise thinks is unsuitable to be removed, it will say something like foo/bar.dvi: 444 mode? and then read a line from stdin. This will swallow the next filename from find, which was intended for xargs. Of course rm -f will omit the check but also will omit any warning for files you can't remove or that can be removed but are not writeable by you. -- Daniel R. Levy UNIX(R) mail: att!ttbcad!levy AT&T Bell Laboratories 5555 West Touhy Avenue Any opinions expressed in the message above are Skokie, Illinois 60077 mine, and not necessarily AT&T's.