From owner-freebsd-questions Wed Feb 9 15: 0:40 2000 Delivered-To: freebsd-questions@freebsd.org Received: from mx2.x-treme.gr (mx2.x-treme.gr [212.120.192.15]) by builder.freebsd.org (Postfix) with ESMTP id 517BA3EC9 for ; Wed, 9 Feb 2000 15:00:35 -0800 (PST) Received: from hades.hell.gr (pat54.x-treme.gr [212.120.197.246]) by mx2.x-treme.gr (8.9.3/8.9.3/IPNG-ADV-ANTISPAM-0.1) with ESMTP id AAA08402; Thu, 10 Feb 2000 00:59:48 +0200 Received: by hades.hell.gr (Postfix, from userid 1001) id 0F6F668E03; Wed, 9 Feb 2000 18:20:46 +0200 (EET) Date: Wed, 9 Feb 2000 18:20:45 +0200 From: Giorgos Keramidas To: John Cc: darryl@osborne-ind.com, freebsd-questions@FreeBSD.ORG Subject: Re: OFF TOPIC - Shell Script Question Message-ID: <20000209182045.B82869@hades.hell.gr> Reply-To: keramida@ceid.upatras.gr References: <001101bf7273$e44dc250$070101c0@ruraltel.net> <4.1.20000208154025.009f3bb0@mail.udel.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0i In-Reply-To: <4.1.20000208154025.009f3bb0@mail.udel.edu>; from papalia@udel.edu on Tue, Feb 08, 2000 at 03:42:31PM -0500 X-PGP-Fingerprint: 62 45 D1 C9 26 F9 95 06 D6 21 2A C8 8C 16 C0 8E X-Phone-Number: +30-94-6203692, +30-93-2886457 X-Address: Theodorou Kirinaiou 61, 26334 Patra, Greece Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Tue, Feb 08, 2000 at 03:42:31PM -0500, John wrote: > >I have a directory with a ton of files in it. I need to move some of > >them to another > >directory. Here's what I'm thinking: > > > >ls -tl | grep '1999' | awk '{print "mv " $9 " /home/darryl/test"}' > > I'm thinking that there has to be some way to do this with find maybe? I > just reviewed the man pages and didn't find the option I was looking for, > but maybe some modification on the line: > > find . -newer "your.oldest.1999.file.here" -ok mv {} /home/darryl/test \; > > Gotta be a better way, but I thought I'd throw that up as food for thought? Actually, this is a pretty nice thing. I really liked the -ok use instead of the usual -exec :) If you're sure that the files are all those that match '*1999*' though, you could easily get away with: % find . -type f -name '*1999*' -exec mv '{}' /home/darryl/test \; -- Giorgos Keramidas, < keramida @ ceid . upatras . gr > For my public PGP key: finger keramida@diogenis.ceid.upatras.gr PGP fingerprint, phone and address in the headers of this message. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message