From owner-freebsd-questions@freebsd.org Sun Jul 1 20:42:02 2018 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DE0C9FDB1F5 for ; Sun, 1 Jul 2018 20:42:02 +0000 (UTC) (envelope-from pschmehl_lists@tx.rr.com) Received: from dnvrco-cmomta01.email.rr.com (dnvrco-outbound-snat.email.rr.com [107.14.73.230]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 620B07D2C6 for ; Sun, 1 Jul 2018 20:42:02 +0000 (UTC) (envelope-from pschmehl_lists@tx.rr.com) Received: from [192.168.0.10] ([70.121.63.82]) by cmsmtp with ESMTPA id ZjALf9w5e5AwUZjAPfs1UY; Sun, 01 Jul 2018 20:41:54 +0000 Date: Sun, 01 Jul 2018 15:41:48 -0500 From: Paul Schmehl Reply-To: Paul Schmehl To: Yasuhiro KIMURA , freebsd-questions@freebsd.org Subject: Re: Problem deleting files Message-ID: <39CDF0B8DF2CB21B11F47BD6@Pauls-MacBook-Pro.local> In-Reply-To: <20180702.044831.477271088854915236.yasu@utahime.org> References: <85B4CFC22AC0CA70B917D42D@Pauls-MacBook-Pro.local> <20180702.044831.477271088854915236.yasu@utahime.org> X-Mailer: Mulberry/4.0.8 (Mac OS X) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline X-CMAE-Envelope: MS4wfAmtoiK89SN8OYjXdBao1ggRKveHNnkjoi+1xVuKYKjrZHWby0CgyYl3ZXIoZgYK2RoArOHdXaaJvWhaYdOCjH/SwzGLztS67XMGJgXza8oZjCkwE5GA oCHPfNwBQVqDgPlYSFMurieymsJfzuBSoB9l/GIKE/CWi2L+kL0MRXwuSvZua56Gwvt7HdXKIXsBCcUhgcjQ7Jpv4NQXWdv8rnyjJxF6a7d2OJojdgMTBI0b X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Jul 2018 20:42:03 -0000 --On July 2, 2018 at 4:48:31 AM +0900 Yasuhiro KIMURA wrote: > From: Paul Schmehl > Subject: Problem deleting files > Date: Sun, 01 Jul 2018 14:13:30 -0500 > >> I have a problem with a directory full of files that I can't seem to >> delete. >> >> rm * returns argument list too long. So does file * >> >> find . -type f -exec rm [] \; returns rm: []: No such file or >> directory over and over again. > > Try following command. > > find . -type f -print0 | xargs -0 rm -f > > If it is only a matter of the number of files, then this should work > well. This seems to be working, although it's taking quite some time. ls | wc -l 4698409 Thanks for the suggestion. It may take a while, but I think this will work. Paul Schmehl, Retired As if it wasn't already obvious, my opinions are my own and not those of my employer. ******************************************* "It is as useless to argue with those who have renounced the use of reason as to administer medication to the dead." Thomas Jefferson "There are some ideas so wrong that only a very intelligent person could believe in them." George Orwell