From owner-freebsd-questions@FreeBSD.ORG Tue Feb 7 22:40:43 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 AF336106567E for ; Tue, 7 Feb 2012 22:40:43 +0000 (UTC) (envelope-from ingo.hofmann@dont-panic.org) Received: from mail.jucktmich.net (mail.jucktmich.net [213.95.10.177]) by mx1.freebsd.org (Postfix) with ESMTP id 6BEF18FC08 for ; Tue, 7 Feb 2012 22:40:42 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mail.jucktmich.net (Postfix) with ESMTP id 977DB3FA90; Tue, 7 Feb 2012 23:15:21 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at jucktmich.net Received: from mail.jucktmich.net ([127.0.0.1]) by localhost (srv01.jucktmich.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id jtRdmt2puTSh; Tue, 7 Feb 2012 23:15:21 +0100 (CET) Received: from [192.168.4.111] (unknown [65.91.54.2]) by mail.jucktmich.net (Postfix) with ESMTPSA id 9E9993FA8F; Tue, 7 Feb 2012 23:15:20 +0100 (CET) Mime-Version: 1.0 (Apple Message framework v1251.1) Content-Type: text/plain; charset=windows-1251 From: Ingo Hofmann In-Reply-To: <4F31A15C.3050506@gmail.com> Date: Tue, 7 Feb 2012 14:15:16 -0800 Content-Transfer-Encoding: quoted-printable Message-Id: <3DFDF5C0-2D39-4A88-B3B5-7D236A7FC4DA@dont-panic.org> References: <1237723287.20120207235924@yandex.ru> <4F31A15C.3050506@gmail.com> To: Rares Aioanei X-Mailer: Apple Mail (2.1251.1) Cc: =?utf-8?B?0JrQvtC90YzQutC+0LIg0JXQstCz0LXQvdC40Lk=?= , 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: Tue, 07 Feb 2012 22:40:43 -0000 What helps me sometimes is wrapping it up: for i in *; do rm $i; done Best, Ingo P.S.: Helps also with whitespaces in the filename where 'rm *' fails too. On 07.02.2012, at 14:10 , Rares Aioanei wrote: > On 02/07/2012 11:59 PM, =CA=EE=ED=FC=EA=EE=E2 =C5=E2=E3=E5=ED=E8=E9 = wrote: >> # rm * >> /bin/rm: Argument list too long. >>=20 >>=20 >> in this directory about 25000 files, >> but actually there is only one argument to rm it is '*' sign. >>=20 >> Why rm get list of all files in directore instead of deleting one by = one? >>=20 >> _______________________________________________ >> 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" >>=20 > AFAIR, the shell expands * to every match , so from this point of view = it is equivalent to the 25000 files. Try 'rm -f [a-d]*' , then [e-h]* or = similar until you get them all. >=20 > Best, >=20 > --=20 > Rares Aioanei >=20 > _______________________________________________ > 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"