[thechat] unix command problem

Anil Garg anilg at niksun.com
Mon Aug 12 08:33:25 CDT 2002


hi,

infact i tweaked my problem earlier....
Actually, i want to delete all the files in a directory with size 0 , using
single command.
Any ideas!!

regards
anil :)
----- Original Message -----
From: "Garrett Coakley" <garrett at polytechnic.co.uk>
To: <thechat at lists.evolt.org>
Sent: Monday, August 12, 2002 7:06 AM
Subject: Re: [thechat] unix command problem


> On Tue, 6 Aug 2002 17:54:35 -0400 "Anil Garg" <anilg at niksun.com> wrote:
>
> > Hi,
> >
> > i get a list of files when i say
> > ls *.php | grep doc
> >
> > now i want to remove all these files which i get (on doing ls *.php |
> > grep doc) from command line and if possible then by using a single
> > command.
>
> 'find' is probably an easier way of doing this:
>
> find ./ -name *doc*.php -exec rm '{}' \;
>
> Which basically translates to: find all files in the current directory
> and below (the ./ bit) that have the php extension and contain 'doc' in
> their file name. Take these files and remove them (the -exec rm '{}'
> bit).
>
> The '{}' gets replaced by each file name found by find and the \; just
> tells it that this is the end of the command.
>
> Remember to back up the files before you use this though *:)
>
> G.
>
>
> --
> -----------------------------------------------------------------------
> WORK: http://www.gencon.co.uk
> PLAY: http://polytechnic.co.uk
> ___________________________________
> thechat mailing list - Ruttling and Strife and IPA.
> thechat at lists.evolt.org
> http://lists.evolt.org/mailman/listinfo/thechat
> http://lists.evolt.org/thechatarchive/
> ____
> I'm not saying there should be a capital punishment for stupidity, but why
don't we just take the safety labels off of everything and let the problem
solve itself?




More information about the thechat mailing list