Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 9 Nov 2010 00:57:51 -0500
From:      Eitan Adler <lists@eitanadler.com>
To:        Pegasus Mc Cleaft <ken@mthelicon.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: removing files
Message-ID:  <AANLkTikPxOEjhF4nXadnZzSGj2F%2BZX0CjSvKjYTFeTOu@mail.gmail.com>
In-Reply-To: <201011080720.29876.ken@mthelicon.com>
References:  <AANLkTik3_atdP6Zbg=utLEVvQLCMyz7f8RDuPU1CtXWa@mail.gmail.com> <201011080720.29876.ken@mthelicon.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Nov 8, 2010 at 2:20 AM, Pegasus Mc Cleaft <ken@mthelicon.com> 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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?AANLkTikPxOEjhF4nXadnZzSGj2F%2BZX0CjSvKjYTFeTOu>