From owner-freebsd-questions Fri Mar 8 18: 3:12 2002 Delivered-To: freebsd-questions@freebsd.org Received: from mired.org (dsl-64-192-6-133.telocity.com [64.192.6.133]) by hub.freebsd.org (Postfix) with SMTP id D76D037B421 for ; Fri, 8 Mar 2002 18:03:00 -0800 (PST) Received: (qmail 8391 invoked by uid 100); 9 Mar 2002 02:02:59 -0000 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15497.27987.227360.616972@guru.mired.org> Date: Fri, 8 Mar 2002 20:02:59 -0600 To: "Jon Larssen" Cc: questions@freebsd.org Subject: Re: find(1) usage In-Reply-To: <1043983@toto.iv> X-Mailer: VM 6.90 under 21.1 (patch 14) "Cuyahoga Valley" XEmacs Lucid X-face: "5Mnwy%?j>IIV\)A=):rjWL~NB2aH[}Yq8Z=u~vJ`"(,&SiLvbbz2W`;h9L,Yg`+vb1>RG% *h+%X^n0EZd>TM8_IB;a8F?(Fb"lw'IgCoyM.[Lg#r\ From: "Mike Meyer" X-Delivery-Agent: TMDA/0.48 (Python 2.2 on freebsd4) Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Jon Larssen types: > I have a backup directory of some important system files, for instance, > backup/etc/master.passwd, backup/etc/groups, etc. Now, if I'm standing just > on backup's parent, I can find the files I need to backup, like: > > find backup/ -name "*" ! -type d -print > > and the result would be > > backup/etc/master.passwd > backup/etc/groups > etc. > > Now, I'd like to use the -exec expression of find(1) to obtain the following > (sample) command: If you have to use exec and cp, you could try this: cd backup find . ! -type d -exec <....> Personally, I'd use cpio. See the cpio man page for details on how to do exactly what you're trying to do. http://www.mired.org/home/mwm/ Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message