Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!purdue!haven!adm!xadmx!drears@PICA.ARMY.MIL From: drears@PICA.ARMY.MIL (Dennis G. Rears (FSAC)) Newsgroups: comp.unix.questions Subject: Re: cleanup script needed Message-ID: <19510@adm.BRL.MIL> Date: 8 May 89 16:38:18 GMT Sender: news@adm.BRL.MIL Lines: 34 rkumar@buddha.usc.edu writes: > >This may be quite silly to the UNIX wizards. > >1) Frequently I need to erase unnecessary files to save space. >It would be nice to have a script which removes all >the files with a specified extension, e.g., .dvi or .aux >not only in the current directory, but in all the >children directories recursively. >Will rm -r *.dvi do the job? Since it is an "rm" command, >I don't want to try it out ... /bin/find DIR -name "*.dvi" -exec rm -f {} \; DIR is the directory that is where you want to start from. The *.dvi must be enclosed in quotes. You might want to use the -i option of rm as opposed to -f depending upon application. > >2) Sometimes I create a file in a directory which is deep >down in a directory hierarchy. Any quick way to search for >a file, given its name/template? > /bin/find DIR -name "filename" -exec ls -l {} \; This will do it. This will give the full path name. >Thanks >Ravi Dennis Dennis G. Rears ARPA: drears@ac4.pica.army.mil UUCP: ...!uunet!ac4.pica.army.mil!drears