From owner-freebsd-questions@FreeBSD.ORG Tue Nov 9 05:58:13 2010 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 14064106566B for ; Tue, 9 Nov 2010 05:58:13 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-iw0-f182.google.com (mail-iw0-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id DB98A8FC13 for ; Tue, 9 Nov 2010 05:58:12 +0000 (UTC) Received: by iwn39 with SMTP id 39so7184079iwn.13 for ; Mon, 08 Nov 2010 21:58:12 -0800 (PST) Received: by 10.231.37.9 with SMTP id v9mr4760757ibd.198.1289282292020; Mon, 08 Nov 2010 21:58:12 -0800 (PST) MIME-Version: 1.0 Received: by 10.231.143.15 with HTTP; Mon, 8 Nov 2010 21:57:51 -0800 (PST) In-Reply-To: <201011080720.29876.ken@mthelicon.com> References: <201011080720.29876.ken@mthelicon.com> From: Eitan Adler Date: Tue, 9 Nov 2010 00:57:51 -0500 Message-ID: To: Pegasus Mc Cleaft Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: freebsd-questions@freebsd.org Subject: Re: removing files X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Nov 2010 05:58:13 -0000 On Mon, Nov 8, 2010 at 2:20 AM, Pegasus Mc Cleaft wrote= : > On Monday 08 November 2010 06:10:20 yoganjaneyulu kasetti wrote: >> hi, >> >> I have a problem for deleting files using script........please some one = can >> guide me for the same. >> >> I have some files with the extension of ".chk" extension along with the >> extension of ".log" and ".gjf" extension in the folder called different >> *input folders. *I wanted to delete the ".chk" file extension having >> files. If i go to individual input folder manually i can delete the file >> with *rm* command line by but i would like to delete all the ".chk" file= s >> extension files at a time through scripting rather than manual. So pleas= e >> some one help me for the same. >> /student/sweety/gaussiandata/*1249624064640*/input >> > > =C2=A0 =C2=A0 =C2=A0 =C2=A0Could you, in your script do something like: > > =C2=A0 =C2=A0 =C2=A0 =C2=A0cd /Path_to_Data_Root > =C2=A0 =C2=A0 =C2=A0 =C2=A0find . -name "*.chk" -print -prune -exec rm -r= f {} \; If you really want to "delete all the ".chk" files extension files at a tim= e" find path -name '*.chk' -print -prune -exec rm -rf {} + \; --=20 Eitan Adler