Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Re: arg list too long in unix

Re: arg list too long in unix

From: Steven Lembark <lembark_at_wrkhors.com>
Date: Thu, 29 Aug 2002 08:23:37 -0800
Message-ID: <F001.004C29CD.20020829082337@fatcity.com>

> I'm not sure xargs will work -- it seems to me that since xargs is
> typically invoked as: 'ls cz* | xargs rm', Nuno is likely to get the same
> arg list too long error. I think the best way to delete the files would
> be: 'find . -name cz\* -exec rm -f {} \;'

Anyone who invokes xargs from "ls *" needs to learn how to use xargs: feed it with things that ae not affected by the arg list. For example:

    find . -type f -name 'cz*' | xargs rm -f;

is one nice way: the '*' is not expanded on the command line but used with an internal glob call in find.

Other problem with using ls for large file op's is that it attempts to sort the output, which is expensive and a memory hog. Find simply spits out matching files as they are found.

--
Steven Lembark                               2930 W. Palmer
Workhorse Computing                       Chicago, IL 60647
                                            +1 800 762 1582
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Steven Lembark
  INET: lembark_at_wrkhors.com

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).
Received on Thu Aug 29 2002 - 11:23:37 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US