Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 28 Jan 2006 19:27:22 -0800
From:      Bill Campbell <freebsd@celestial.com>
To:        freebsd-questions@freebsd.org
Subject:   Re: rm - Argument list too long
Message-ID:  <20060129032722.GB85318@alexis.mi.celestial.com>
In-Reply-To: <200601281733.47099.kirk@strauser.com>
References:  <927ad6550601271534r17a6ddb2jd90b930f744d170f@mail.gmail.com> <9873AD032E93C851484DF81B@utd59514.utdallas.edu> <200601281733.47099.kirk@strauser.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, Jan 28, 2006, Kirk Strauser wrote:
>On Friday 27 January 2006 17:52, Paul Schmehl wrote:
>> for files in *.*
>> do
>> rm $files
>> done
>
>Don't ever, *EVER* blindly unlink glob expansions.  It's bad for you.
>
>Instead, use something like:
>
>    find . -name 'sess.*' -delete

While that's good advice, it doesn't answer the question of argument list
too long.

The short answer is read ``man xargs''.

find . | xargs command

Bill
--
INTERNET:   bill@Celestial.COM  Bill Campbell; Celestial Systems, Inc.
URL: http://www.celestial.com/  PO Box 820; 6641 E. Mercer Way
FAX:            (206) 232-9186  Mercer Island, WA 98040-0820; (206) 236-1676

``A Democracy cannot exist as a permanent form of government.  It can only
exist until the voters discover they can vote themselves largesse out of
the public treasury.  From the moment on the majority always votes for the
candidate promising the most benefits from the public treasury with the
result that Democracy always collapses over a loose fiscal policy, always
to be followed by a Dictatorship.''
	Professor Alexander Fraser Tytler.  1801



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