Searching for specific files then delete them

Tony Arnold tony.arnold at manchester.ac.uk
Tue Aug 29 13:24:35 UTC 2006


On Tue, 2006-08-29 at 13:01 +0200, Dieter Schicker wrote:
> On Tue, 2006-08-29 at 13:29 +0300, OOzy Pal wrote:
> > How can I search for specific files then delete them. I tried this but
> > no it did not work
> > 
> > find -name *~|rm
> > 
> > -- 
> > OOzy
> > Kubuntu-Dapper
> > 
> 
> find . -name *~ | xargs rm

or

find . -name *~ -exec rm {} \;

The rm command gets executed for each file found and the {} is
substituted with the file name. The \; is necessary syntax to terminate
the -exec option.

Regards,
Tony.
-- 
Tony Arnold, IT Security Coordinator, University of Manchester,
IT Services Division, Kilburn Building, Oxford Road, Manchester M13 9PL.
T: +44 (0)161 275 6093, F: +44 (0)870 136 1004, M: +44 (0)773 330 0039
E: tony.arnold at manchester.ac.uk, H: http://www.man.ac.uk/Tony.Arnold





More information about the ubuntu-users mailing list