recursively deleting *.dvi files
Jonathan I. Kamens
jik at athena.mit.edu
Mon Oct 22 05:26:43 AEST 1990
In article <1828 at utodaycom>, sean at utodaycom (Sean Fulton) writes:
|> Try:
|> find . -name `*.dvi` -print -exec rm -f {} \;
Backquotes won't do the right thing in any of the shells I've used.
Backquotes are for command evaluation and output substitution, not for
wildcard quoting. The command above will try to run a command called "*.dvi",
which will obviously fail. Try:
find . -name '*.dvi' -print -exec rm -f {} \;
Or, if you know there aren't that many of them, try:
rm -rf `find . -name '*.dvi' -print`
Or, if you are unsure how many of them there are and you have xargs (and you
aren't worried about the xargs security holes that have been discussed
recently being present in your home directory :-):
find . -name '*.dvi' -print | xargs rm -f
--
Jonathan Kamens USnail:
MIT Project Athena 11 Ashford Terrace
jik at Athena.MIT.EDU Allston, MA 02134
Office: 617-253-8085 Home: 617-782-0710
More information about the Comp.unix.shell
mailing list