From owner-freebsd-questions@FreeBSD.ORG Fri Feb 10 16:19:20 2012 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1A719106564A for ; Fri, 10 Feb 2012 16:19:20 +0000 (UTC) (envelope-from jerrymc@gizmo.acns.msu.edu) Received: from gizmo.acns.msu.edu (gizmo.acns.msu.edu [35.8.1.43]) by mx1.freebsd.org (Postfix) with ESMTP id B16368FC0A for ; Fri, 10 Feb 2012 16:19:19 +0000 (UTC) Received: from gizmo.acns.msu.edu (localhost [127.0.0.1]) by gizmo.acns.msu.edu (8.13.6/8.13.6) with ESMTP id q1AGG1J4088068; Fri, 10 Feb 2012 11:16:01 -0500 (EST) (envelope-from jerrymc@gizmo.acns.msu.edu) Received: (from jerrymc@localhost) by gizmo.acns.msu.edu (8.13.6/8.13.6/Submit) id q1AGG1lq088067; Fri, 10 Feb 2012 11:16:01 -0500 (EST) (envelope-from jerrymc) Date: Fri, 10 Feb 2012 11:16:01 -0500 From: Jerry McAllister To: Henry Olyer Message-ID: <20120210161601.GA87996@gizmo.acns.msu.edu> References: <1237723287.20120207235924@yandex.ru> <4F31A260.20109@infracaninophile.co.uk> <20120207231716.31aa8bc3@gumby.homeunix.com> <20120209032544.GA58560@ozzmosis.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.2i Cc: andrew clarke , freebsd-questions@freebsd.org Subject: Re: 'rm' Can not delete files X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 16:19:20 -0000 On Fri, Feb 10, 2012 at 10:34:20AM -0500, Henry Olyer wrote: > So what do I change if I want to increase the shell's file limit? You don't want to diddle the shell. Use the correct UNIX utilities such as - for, xargs or find - in this case as have been suggested by other responders. That is the way it is done (and done better) in UNIX. > > I use bash 4. OK. So?? > I never learned a shell language. I suppose no one is as dumb as someone > who choose's not to learn, so, what's the right one. csh?, because I do a > lot of scientific work?, or should I be looking at another? > Probably doesn't matter that much what type of work you are doing. It matters more what the users of a system tend to use. In FreeBSD it is tcsh which is basically an extension of csh. Actually, nowdays on FreeBSD, csh is just a link to tcsh anyway. On Lunix, I think most people use bash, so if you are there, do that. There are some small differences that are meaningful depending on what kind of scripting you are doing. But, mostly it doesn't matter a lot. ////jerry > > > On Wed, Feb 8, 2012 at 10:25 PM, andrew clarke wrote: > > > On Tue 2012-02-07 23:17:16 UTC+0000, RW (rwmaillists@googlemail.com) > > wrote: > > > > > On Tue, 07 Feb 2012 22:14:56 +0000 > > > Matthew Seaman wrote: > > > > > > > ls -1 | xargs rm > > > > > > but be aware that that wont work for filenames with spaces. > > > > In addition, I don't believe it solves the OP's initial problem of the > > argument list being too long! You'd probably need to use the xargs -n > > switch here. > > > > The above will also try to 'rm' directories, which won't work. > > > > Instead I would use 'find': > > > > find . -type f -depth 1 -delete > > > > This will also work with filenames with spaces. > > > > Or the scenic route, using xargs, with one rm per file (slower): > > > > find . -type f -depth 1 -print0 | xargs -n1 -0 rm -f > > > > (The "scenic route" is useful if you want to do something else with > > the files instead of deleting them with rm.) > > > > Regards > > Andrew > > _______________________________________________ > > freebsd-questions@freebsd.org mailing list > > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > > To unsubscribe, send any mail to " > > freebsd-questions-unsubscribe@freebsd.org" > > > _______________________________________________ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org"