Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 10 Feb 2012 10:29:53 -0800
From:      merlyn@stonehenge.com (Randal L. Schwartz)
To:        Matthew Seaman <m.seaman@infracaninophile.co.uk>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: 'rm' Can not delete files
Message-ID:  <86zkcqr17i.fsf@red.stonehenge.com>
In-Reply-To: <4F3541D6.5080505@infracaninophile.co.uk> (Matthew Seaman's message of "Fri, 10 Feb 2012 16:12:06 %2B0000")
References:  <1237723287.20120207235924@yandex.ru> <4F31A260.20109@infracaninophile.co.uk> <20120207231716.31aa8bc3@gumby.homeunix.com> <20120209032544.GA58560@ozzmosis.com> <CAE7N2kdmbm_5=c8oNknYQE5HOrvVjtfS4XTGYvxTjEQVbGr-7Q@mail.gmail.com> <4F3541D6.5080505@infracaninophile.co.uk>

next in thread | previous in thread | raw e-mail | index | archive | help
>>>>> "Matthew" == Matthew Seaman <m.seaman@infracaninophile.co.uk> writes:

Matthew>    find . -type f -depth 1 -exec rm -f '{}' ';'

Matthew> but let's not leave people in any doubt that this is not the
Matthew> best option.

However...

  find . -type f -depth 1 -exec rm -f {} +

Might very well be a great option.  Well, not for something that is also
like -delete, but for other things that would have formerly required
"-print0 | xargs -0"... this is apparently a fairly recent (and
welcome!) modification to find.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>;
Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.
See http://methodsandmessages.posterous.com/ for Smalltalk discussion



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?86zkcqr17i.fsf>