From owner-freebsd-questions Wed Mar 6 18:26:37 2002 Delivered-To: freebsd-questions@freebsd.org Received: from globalrelay.com (h216-18-71-77.gtcust.grouptelecom.net [216.18.71.77]) by hub.freebsd.org (Postfix) with ESMTP id C68CC37B400 for ; Wed, 6 Mar 2002 18:26:30 -0800 (PST) Received: from [24.83.78.94] (HELO cns) by globalrelay.com (CommuniGate Pro SMTP 3.4.7) with SMTP id 902077; Wed, 06 Mar 2002 18:26:29 -0800 Message-ID: <003501c1c57f$b1b96400$5e4e5318@cns> From: "Eric Parusel" To: "Bsd Neophyte" , References: <20020307020236.7623.qmail@web20110.mail.yahoo.com> Subject: Re: question about the 'find' command Date: Wed, 6 Mar 2002 18:27:56 -0800 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 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 > my unix text talks about the 'find' command... it further goes to talk > about an "action" used with the find command. > > I am completely confused as to what the {} do with the find comand. > > the explanation is this: "A set of braces, {}, delimits where the file > name is passed to the command from the prceding expressions." > > Now what does this mean? It makes no sense to me. > > an example they give is the following: > > $ find ~ -name core -exec rm {} \; This will result in find finding, for example: ./dira/core ./otherdir/core ./anotherdir/core For each file found, "rm" will be run, with the name & path of the file found being an argument (that's what the {} is for).... So find will run: rm ./dira/core rm ./otherdir/core rm ./anotherdir/core So before you run something like this you'll want to leave off the "-exec {} \;:" arguments, and see what files you're about to delete :) You might want to try "man find" also. If you're not sure about a command, read the man pages, they're really useful! Later, Eric To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message