Re: use find to generate print list
On Sat, Jan 25, 2020 at 09:23:12AM +0100, tomas@tuxteam.de wrote:
> On Sat, Jan 25, 2020 at 07:43:40AM +0000, Russell L. Harris wrote:
> > In the "find" man page is an example which uses (1) "-prune" to
> > exclude a directory and (2) "! -name '*~'" to exclude both files and
> > directories the name of which end in "~":
> >
> > find . -name .snapshot -prune -o \( \! -name '*~' -print0 \)|
> > cpio -pmd0 /dest-dir
> >
> > I have tried without success to alter the command so as to prune two
> > directories (".git" and "projectlog")
>
> find . -name .git -prune -o -name projectlog -prune -o <your-stuff-here>
>
> should work.
>
> (try -print instead of <your-stuff-here> to verify whether you're getting
> what you expect).
>
find . -name .git -prune \( -name projectlog -o <your-stuff-here> \)
should also work
Regards,
-Roberto
--
Roberto C. Sánchez
Reply to: