From owner-freebsd-questions Thu Jan 2 17:55: 8 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 D723C37B401 for ; Thu, 2 Jan 2003 17:55:07 -0800 (PST) Received: from fep01-mail.bloor.is.net.cable.rogers.com (fep01-mail.bloor.is.net.cable.rogers.com [66.185.86.71]) by mx1.FreeBSD.org (Postfix) with ESMTP id EC2FE43E4A for ; Thu, 2 Jan 2003 17:55:06 -0800 (PST) (envelope-from mj001@rogers.com) Received: from rogers.com ([24.101.253.54]) by fep01-mail.bloor.is.net.cable.rogers.com (InterMail vM.5.01.05.06 201-253-122-126-106-20020509) with ESMTP id <20030103015442.SDZM4715.fep01-mail.bloor.is.net.cable.rogers.com@rogers.com>; Thu, 2 Jan 2003 20:54:42 -0500 Message-ID: <3E14ED79.3040302@rogers.com> Date: Thu, 02 Jan 2003 20:55:05 -0500 From: Mike Jeays User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.0.1) Gecko/20021005 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 X-Authentication-Info: Submitted using SMTP AUTH PLAIN at fep01-mail.bloor.is.net.cable.rogers.com from [24.101.253.54] using ID at Thu, 2 Jan 2003 20:54:42 -0500 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. > >To Unsubscribe: send mail to majordomo@FreeBSD.org >with "unsubscribe freebsd-questions" in the body of the message > > > This should do it. Note the use of back-ticks to execute a command for f in `find . -name "*pdf"` do mv $f /target-directory done To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message