Re: Unix command(s) to remove files recursively?
On Tue, Jun 05, 2012 at 11:42:35AM BST, Rodolfo Medina wrote:
> Hi.
Hi,
> Suppose that I have, in a certain directory and all its subdirs and subdirs'
> subdirs' subdirs... etc., a certain number of files terminating with `~', e.g.:
> `myfile~', and that I want to remove all of them recursively. Is there a Unix
> command to do that right away?
find top_dir_name -type f -name "*~" -exec rm '{}' \;
man find
P.S. While you're at it I suggest "man xargs" - you'll find it more
useful than "-exec" with certain uses of find.
Cheers,
--
rjc
Reply to: