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

Re: use find to generate print list



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).

Cheers
-- t

Attachment: signature.asc
Description: Digital signature


Reply to: