From owner-freebsd-questions Mon Apr 8 8: 9:14 2002 Delivered-To: freebsd-questions@freebsd.org Received: from mobil.cz (diana.mobil.cz [194.228.200.160]) by hub.freebsd.org (Postfix) with ESMTP id C33F037B400 for ; Mon, 8 Apr 2002 08:09:09 -0700 (PDT) Received: from ester.mobil.cz (ester.mobil.cz [194.213.62.23]) by mobil.cz (8.11.6/8.11.0) with ESMTP id g38F98Z32285; Mon, 8 Apr 2002 17:09:08 +0200 Received: from roman.mobil.cz ([10.2.0.89]) by ester.mobil.cz (Lotus Domino Release 5.0.9a) with ESMTP id 2002040817083073:22 ; Mon, 8 Apr 2002 17:08:30 +0200 Received: (from roman@localhost) by roman.mobil.cz (8.11.6/8.11.6) id g38FOKT12698; Mon, 8 Apr 2002 17:24:20 +0200 (CEST) (envelope-from neuhauser@mail.cz) X-Authentication-Warning: roman.mobil.cz: roman set sender to neuhauser@mail.cz using -f Date: Mon, 8 Apr 2002 17:24:20 +0200 From: Roman Neuhauser To: Radhika Sambamurti Cc: freebsd-questions@freebsd.org Subject: Re: -exec script question Message-ID: <20020408152420.GA12083@roman.mobil.cz> Mail-Followup-To: Radhika Sambamurti , freebsd-questions@freebsd.org References: <20020408135739.74130.qmail@web9307.mail.yahoo.com> Mime-Version: 1.0 In-Reply-To: <20020408135739.74130.qmail@web9307.mail.yahoo.com> User-Agent: Mutt/1.3.26i X-MIMETrack: Itemize by SMTP Server on ester/Mobil(Release 5.0.9a |January 7, 2002) at 04/08/2002 05:08:30 PM, Serialize by Router on ester/Mobil(Release 5.0.9a |January 7, 2002) at 04/08/2002 05:08:36 PM, Serialize complete at 04/08/2002 05:08:36 PM Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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 > Date: Mon, 8 Apr 2002 06:57:39 -0700 (PDT) > From: Radhika Sambamurti > Subject: -exec script question > To: freebsd-questions@freebsd.org > > hi, > I am trying to create a script to move files over 7 days > old. my quesions is how can i use the -exec command with > mv? > > so far i have; > > find / -name \*inc -mtime +7 -exec mv /usr/tmp {}; > > would this be correct? if you want find(1) to move /usr/tmp to the first file it finds according to the criteria then, almost, yes. :) find / -name '*inc' -mtime +7 -exec mv {} /usr/tmp \; note the backslash before the semicolon, and the space before the backslash. -- FreeBSD 4.4-STABLE 5:21PM up 15 days, 7 mins, 5 users, load averages: 0.09, 0.10, 0.08 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message