From owner-freebsd-questions@FreeBSD.ORG Fri Feb 10 15:56:39 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 32862106567B for ; Fri, 10 Feb 2012 15:56:39 +0000 (UTC) (envelope-from freebsd-questions@herveybayaustralia.com.au) Received: from mail.unitedinsong.com.au (mail.unitedinsong.com.au [150.101.178.33]) by mx1.freebsd.org (Postfix) with ESMTP id CEEF98FC1D for ; Fri, 10 Feb 2012 15:56:38 +0000 (UTC) Received: from mail.unitedinsong.com.au (bell.herveybayaustralia.com.au [192.168.0.40]) by mail.unitedinsong.com.au (Postfix) with ESMTP id E0F1B5C2B for ; Sat, 11 Feb 2012 02:09:13 +1000 (EST) Received: from laptop1.herveybayaustralia.com.au (laptop1.herveybayaustralia.com.au [192.168.0.177]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mail.unitedinsong.com.au (Postfix) with ESMTPSA id D726C5C29 for ; Sat, 11 Feb 2012 02:09:12 +1000 (EST) Message-ID: <4F353D1F.3020100@herveybayaustralia.com.au> Date: Sat, 11 Feb 2012 01:51:59 +1000 From: Da Rock User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:7.0.1) Gecko/20111109 Thunderbird/7.0.1 MIME-Version: 1.0 To: freebsd-questions@freebsd.org References: <1237723287.20120207235924@yandex.ru> <4F31A260.20109@infracaninophile.co.uk> <20120207231716.31aa8bc3@gumby.homeunix.com> <20120209032544.GA58560@ozzmosis.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: 'rm' Can not delete files X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: freebsd-questions@freebsd.org List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 15:56:39 -0000 On 02/11/12 01:34, Henry Olyer wrote: > So what do I change if I want to increase the shell's file limit? I don't think you can. It's not a shell limit. It's a limit to the number of arguments the command itself will take. As said, the shell expands '*' to a list of files as the argument, and rm is limited to the number of arguments it will parse. > I use bash 4. > > And by the way, for me, part of the normal installation of a new FBSD box > is to make certain changes. For example, for "uniq -c" I use "%06" instead > of "%d" because this way I can sort the output. Things like that. > > 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? There's not really much difference in this factor for shell types; as for changes you'd have to hack the command's (say rm) code. As mentioned, I'd use the find -delete combination. > 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"