From owner-freebsd-questions@FreeBSD.ORG Fri Feb 10 17:44:35 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 BC750106564A for ; Fri, 10 Feb 2012 17:44:35 +0000 (UTC) (envelope-from kes-kes@yandex.ru) Received: from forward14.mail.yandex.net (forward14.mail.yandex.net [IPv6:2a02:6b8:0:801::4]) by mx1.freebsd.org (Postfix) with ESMTP id BD7A38FC12 for ; Fri, 10 Feb 2012 17:44:34 +0000 (UTC) Received: from smtp11.mail.yandex.net (smtp11.mail.yandex.net [95.108.130.67]) by forward14.mail.yandex.net (Yandex) with ESMTP id 0E2261983900; Fri, 10 Feb 2012 21:44:33 +0400 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1328895873; bh=BIYjGN/zNOvXngsweqszsTPcETfWtuEBnyjZ1lmCzCk=; h=Date:From:Reply-To:Message-ID:To:CC:Subject:In-Reply-To: References:MIME-Version:Content-Type:Content-Transfer-Encoding; b=jwOHkvRxI+zGGwQPobj9ZwNTiSMevMTFeMOud1B+6kWtRsyK7zhXRO/Pkajgdgldx gZ6vJ66WgpjGK0wbigIE03uzt5vE9OlYnHuTWp6Y5zYnw1AuFfcr0tKoHp/xpCaj2n 65k7nwFh1cIm2zbea7E36FNeHQzCClFPpNEnNhx0= Received: from smtp11.mail.yandex.net (localhost [127.0.0.1]) by smtp11.mail.yandex.net (Yandex) with ESMTP id DAC137E0230; Fri, 10 Feb 2012 21:44:32 +0400 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1328895872; bh=BIYjGN/zNOvXngsweqszsTPcETfWtuEBnyjZ1lmCzCk=; h=Date:From:Reply-To:Message-ID:To:CC:Subject:In-Reply-To: References:MIME-Version:Content-Type:Content-Transfer-Encoding; b=tqMuF72+Ze0k7dKO/+s6LPX5XTvwm0Xp93WsilJSVsDIS/VTakbOyO4OR9ZGGrPAG C08buZ1OVQMHjKm54CCJ4VfPxfHvkDtpSAMTEujXy8Qsq5wj6C/ObgxQIIBCZSjqxJ I6up0tdcPujc0gLCT30i4DLi3YyBJwE9OAlu1NLY= Received: from unknown (unknown [77.93.52.20]) by smtp11.mail.yandex.net (nwsmtp/Yandex) with ESMTP id iWhSk7QW-iWh8oGgs; Fri, 10 Feb 2012 21:44:32 +0400 X-Yandex-Spam: 1 Date: Fri, 10 Feb 2012 19:44:30 +0200 From: =?utf-8?B?0JrQvtC90YzQutC+0LIg0JXQstCz0LXQvdC40Lk=?= X-Mailer: The Bat! (v4.0.24) Professional Organization: =?utf-8?B?0KfQnyDQmtC+0L3RjNC60L7QsiwgRnJlZUxpbmU=?= X-Priority: 3 (Normal) Message-ID: <902108869.20120210194430@yandex.ru> To: Da Rock In-Reply-To: <4F353D1F.3020100@herveybayaustralia.com.au> References: <1237723287.20120207235924@yandex.ru> <4F31A260.20109@infracaninophile.co.uk> <20120207231716.31aa8bc3@gumby.homeunix.com> <20120209032544.GA58560@ozzmosis.com> <4F353D1F.3020100@herveybayaustralia.com.au> MIME-Version: 1.0 Content-Type: text/plain; charset=windows-1251 Content-Transfer-Encoding: 8bit Cc: freebsd-questions@freebsd.org Subject: Re[2]: 'rm' Can not delete files X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: =?utf-8?B?0JrQvtC90YzQutC+0LIg0JXQstCz0LXQvdC40Lk=?= List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 17:44:35 -0000 Здравствуйте, Da. Вы писали 10 февраля 2012 г., 17:51:59: DR> On 02/11/12 01:34, Henry Olyer wrote: >> So what do I change if I want to increase the shell's file limit? DR> I don't think you can. It's not a shell limit. It's a limit to the DR> number of arguments the command itself will take. As said, the shell DR> expands '*' to a list of files as the argument, and rm is limited to the DR> number of arguments it will parse. Mya be it would be better in program do not process options 'all at once'. but instead process them one by one: get next option, remove file, get next option, remove file .... for $i in (@options) do delete_file( $i ) >> 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? DR> There's not really much difference in this factor for shell types; as DR> for changes you'd have to hack the command's (say rm) code. DR> 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 -- С уважением, Коньков mailto:kes-kes@yandex.ru