From owner-freebsd-questions Thu Jan 2 17:58:13 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 2DA7F37B401 for ; Thu, 2 Jan 2003 17:58:12 -0800 (PST) Received: from sub21-156.member.dsl-only.net (sub21-156.member.dsl-only.net [63.105.21.156]) by mx1.FreeBSD.org (Postfix) with ESMTP id AE1E143EC5 for ; Thu, 2 Jan 2003 17:58:11 -0800 (PST) (envelope-from nkinkade@sub21-156.member.dsl-only.net) Received: from nkinkade by sub21-156.member.dsl-only.net with local (Exim 4.10) id 18UH6B-000H5m-00 for freebsd-questions@freebsd.org; Thu, 02 Jan 2003 17:58:11 -0800 Date: Thu, 2 Jan 2003 17:58:11 -0800 From: Nathan Kinkade To: freebsd-questions@freebsd.org Subject: Re: Shell guru needed. Message-ID: <20030103015811.GA65686@sub21-156.member.dsl-only.net> Reply-To: nkinkade@dsl-only.net Mail-Followup-To: freebsd-questions@freebsd.org References: <200301030103.h0313b67012698@labs.unixhideout.com> <20030103015255.GM5327@sub21-156.member.dsl-only.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030103015255.GM5327@sub21-156.member.dsl-only.net> User-Agent: Mutt/1.4i 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 On Thu, Jan 02, 2003 at 05:52:55PM -0800, Nathan Kinkade wrote: > On Thu, Jan 02, 2003 at 08:03:37PM -0500, 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. > > First, turn on line-wrapping in your MUA. > > find /path/to/my/libarary -name *.pdf -exec mv {} /new/dir/{} \; > > Nathan Sorry, I wasn't thinking here....after I double check the man page I saw that -exec replaces {} with the path, not just the file name....the above will not work...use the if;do;done syntax that someone else has already posted. Thanks! Nathan To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message