From owner-freebsd-questions@FreeBSD.ORG Tue Feb 7 22:34:50 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 C33D9106566C for ; Tue, 7 Feb 2012 22:34:50 +0000 (UTC) (envelope-from andre@drenet.info) Received: from mail-vw0-f54.google.com (mail-vw0-f54.google.com [209.85.212.54]) by mx1.freebsd.org (Postfix) with ESMTP id 7CC008FC12 for ; Tue, 7 Feb 2012 22:34:50 +0000 (UTC) Received: by vbbfa15 with SMTP id fa15so7650538vbb.13 for ; Tue, 07 Feb 2012 14:34:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=drenet.info; s=google; h=mime-version:x-originating-ip:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=fHVkcqGAl+qLuf+rSQYJPN5xPJaMBSSQZsdufttNJ+s=; b=FmEdR+b7Lxx/RPvKB7CaewG4jck9wp10zvj0gJjkgdRllyvLGgBrJxAPdIDjr/uhRu xCCpHUkO9DxhWGc1kEaAe8Sxa9EMWhAQNfQxPtQmR1IfeQd74bIfYCW3ZRygxJTqdGAX bJ8FoctOGh0YS4GYs0rV44+63+dzDgmZz9FQw= MIME-Version: 1.0 Received: by 10.52.88.144 with SMTP id bg16mr10985123vdb.64.1328652452380; Tue, 07 Feb 2012 14:07:32 -0800 (PST) Received: by 10.220.140.18 with HTTP; Tue, 7 Feb 2012 14:07:32 -0800 (PST) X-Originating-IP: [71.1.155.219] In-Reply-To: <1237723287.20120207235924@yandex.ru> References: <1237723287.20120207235924@yandex.ru> Date: Tue, 7 Feb 2012 17:07:32 -0500 Message-ID: From: Andre Goree To: =?KOI8-R?B?68/O2MvP1yDl18fFzsnK?= Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: 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:34:50 -0000 2012/2/7 =EB=CF=CE=D8=CB=CF=D7 =E5=D7=C7=C5=CE=C9=CA > # rm * > /bin/rm: Argument list too long. > > > in this directory about 25000 files, > but actually there is only one argument to rm it is '*' sign. > > Why rm get list of all files in directore instead of deleting one by one? > > _______________________________________________ > 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" > The 'rm' command lists each file in the directory prior to removing it. For very large directories, the proper (and faster in other cases) way is to user 'find', such as below: # find . -delete or, if you only want to delete files (leaving the directories): # find . -type f -delete