From owner-freebsd-questions Thu Jan 2 17:54:15 2003 Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id CE9A637B401 for ; Thu, 2 Jan 2003 17:54:14 -0800 (PST) Received: from rwcrmhc52.attbi.com (rwcrmhc52.attbi.com [216.148.227.88]) by mx1.FreeBSD.org (Postfix) with ESMTP id 85ED243EA9 for ; Thu, 2 Jan 2003 17:54:14 -0800 (PST) (envelope-from pkdb1@attbi.com) Received: from attbi.com (12-231-115-57.client.attbi.com[12.231.115.57]) by rwcrmhc52.attbi.com (rwcrmhc52) with SMTP id <2003010301541405200seuebe>; Fri, 3 Jan 2003 01:54:14 +0000 Message-ID: <3E14ED45.5060506@attbi.com> Date: Thu, 02 Jan 2003 17:54:13 -0800 From: paul User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.1) Gecko/20021210 X-Accept-Language: en-us, en MIME-Version: 1.0 To: mike Cc: freebsd-questions@FreeBSD.ORG Subject: Re: Shell guru needed. References: <200301030103.h0313b67012698@labs.unixhideout.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit 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 mike wrote: > Hey guys. heres the skinny. I have a huge library and i want to > organize it. I want find to go through recursively, and move > any "pdf" files it finds to a certain directory. I need an > example piece of script on how i would confront this. It will > save me hours if not days so thanks in advance. > you don't say if you need to preserve any of the path information when you move the file. The other poster's suggestion might work: my take on it would be to use a for loop: for i in `find /some/dir -name "*.pdf"`; do mv $i /some/other/dir; done -- Paul Beard: seeking UNIX/internet engineering work 8040 27th Ave NE Seattle WA 98115 / 206 529 8400 There's no real need to do housework -- after four years it doesn't get any worse. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message