help-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: preserve particular files within a directory using rm command


From: Dave Hylands
Subject: Re: preserve particular files within a directory using rm command
Date: Wed, 13 May 2009 22:10:00 -0700

Hi,

I meant to reply to the list...

On Mon, May 11, 2009 at 4:18 PM, aaburomeh <address@hidden> wrote:
>
> Hey guys. I'm new to the whole make idea.
> I have a directory containing my .svn folder and other *.c, *.h and *.mak
> files.
> is there a way to use the "rm" to delete all files and folders within this
> directory except the .svn folder?

This isn't really a make question.
You can use the find command to come up with a list of names:

find . ! \( -name .svn -prune \) -type f

and then modify it to remove all files that were found:

find . ! \( -name .svn -prune \) -type f -exec rm {} \;

-- 
Dave Hylands
Shuswap, BC, Canada
http://www.DaveHylands.com/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]